mark's banner

Saturday, April 12, 2008

China


Just got back from China! Visited Shanghai, Guangzhou, and Hong Kong. The picture is from a side street off Nathan Road in Kowloon.

The trip was short, but very educational. And, I have to say, despite the pre-trip research, I was a little surprised with the amount of development in south eastern China. Shanghai especially is a very exciting place and the Chinese should be proud of their accomplishments here. Some tempering of the exuberance is a must given the obvious internal policies, but there is considerable evidence in the cities we visited that result from economic policy are positive.

Design automation wasn't part of the agenda for this trip, but there are opportunities for European, and North American firms in this emerging economy. I recommend, at the very least some analysis and investigation, especially if your local opportunities are maxed out. China isn't just a place to get manufactured goods cheap. It is a consumer of goods and services, and there are incredibly massive amounts of infrastructure development.

If you're curious and looking for a place to start, check out AmCham - The American Chamber of Commerce South China.

Sunday, March 16, 2008

Snap.com

I've added a new feature called snap shots. It shows you where the link will take you before you click. I've enabled the feature for external links like this one, snap. Notice the comment icon after the link? This icon indicates that snap is enabled for the link. I hope it helps. Post a comment if you have ideas for the site.

Labels:

Saturday, March 01, 2008

Sketchup Ruby - Mark's First Ruby Script


Instead of doing homework today I spent most of the day hacking my way through a simple ruby script. Ruby on Rails is the scripting language adopted by Sketchup. There is lots of information available for Ruby, but I stuck to only the sketchup resources - they seemed more relevant.

What I wanted to do with this script was to find all of the entities in the file that had the same attribute. In this case I made the script even less elegant by taking advantage of the entity's definition name. All entities seem to have this parameter so I was able to take advantage of it y using sketchup's gui and then by extracting the name in the script - that is, no need to build my own dialog (maybe my next lesson - there are some interesting examples delivered with sketchup).

Essentially, what the script does is request all entities in the model and then enumerates through each. The entity definition name is compared to the string I want to find, in this case Display Panel and if a match is found increment the counter. When the script is done it returns a count of Display Panels and ignores entities with other definition names.

A second script is included in panel.rb. This is a simple request for the total number of entities in the model. This script is quites simple it simple uses the model.entities.count method to return the total. UI.message prints the result in both cases.

Panel.zip includes the test.skp file, and the ruby script panel.rb.