ID - Definition Name
-
Good day !
If there is a list of the ID of the Components or Groups in the Model, is there a possibility to get the list Definition Name (Name, Dynamic Name) in the form :
ID - Definition Name
ID - Definition Name
....
ID - Definition Name -
You are asking about several different things...
model = Sketchup.active_model defns = model.definitions
### the definitions in the model - components/groups/images
p defns[0].methods.sort
### for list of a definition's available methods - also see API guide http://www.sketchup.com/intl/en/developer/docs/classes.php
defns.each{|d| p d.name ### name of defn p d.instances[0].name if d.group? ### name if it's a group p d.get_attribute("dynamic_attributes", "_name", "???") ### if DC 'name' or '???' if not. p d.guid ### the unique GUID for the definition - Note: this only enduring across sessions in newer SketchUp version. }
Advertisement