I want text tool to show attributes other than area etc.
-
So when you use the text tool as a label you get the following.
if face then - area
if edge then - distance
if component/group then - nameHas anyone tried to create a similar tool that uses a different entity attribute such as material or a custom attribute field (cost for example).
Now another issue with these text labels is that they aren't dynamic. It would be great if an observer could update this when entities are changed. Or if nothing else a manual (re-calculate all) button.
-
That is all do-able, and I don't think anyone has done it yet. The auto-regeneration might need to have a button like you suggest, but maybe not. I am not sure how those observer's work, or don't work... But making your own tool to add text notes is easy enough for sure. I can mock up an example later today if you would like. Its all of about 20 lines of code or less. Maybe under 10.
Chris
-
I'm working on an AreaTag Tool so so and EdgeTag and InstanceTag Tool would be a simple progression - it's a week or two down the list...
-
Chris, if you don't mind, that would be great. I've wanted labels to be more dynamic for a long time.
Looking at the Text class
http://code.google.com/intl/zh-CN/apis/sketchup/docs/ourdoc/text.htmlIt seems like if you create a text object via ruby vs. with the existing text tool you can use this method to apply text
Text.text=I guess you can grab the variable from the attribute_dictionary to use.
Then if you want to update a set of text labels (within some set of rules for what type of attribute to use for different types of objects) you could have a script iterate through all text objects to update. Maybe I would use layers as a way to determine what type of data I want for a label. The active layer could be used when first creating a text object to determine what I want to show, and then if I move the text object to another layer and re-calculate, it would change the attribute to match the layer. Just thinking . . .
-
Advertisement