DC Report
-
Does anyone know? Is there anyway to get a report of the formulas in a DC? Obviously the native SU report generator (File>Generate Report...) only reports values, not formulas. Perhaps there is a plugin that might work?
-
I run this code on one of my doors
` model = Sketchup.active_model
definitions = model.definitionsdefinitions.each{ |defs|
dicts = defs.attribute_dictionaries()
next if dicts == nildicts.each{ |dict|
next if dict.name != 'dynamic_attributes'
puts '', "dictionary: #{dict.name}, definition #{defs.name}"
dict.each_pair{ |key, value|
puts "key: #{key}, value: #{value}"
}
}
}`dictionary: dynamic_attributes, definition 96 mm Wire Pull
key: _description_label, value: Description
key: _formatversion, value: 1.0
key: _has_movetool_behaviors, value: 0.0
key: _lastmodified, value: 2014-03-13 08:29
key: _lengthunits, value: CENTIMETERS
key: _name, value: 96 mm Wire Pull
key: description, value: Cabinet Pull for 96 mm drillingdictionary: dynamic_attributes, definition Door#1
key: _lengthunits, value: CENTIMETERS
key: _rotz_formula, value: angle
key: angle, value: 0
key: lenx, value: 40.0
key: leny, value: 76.8
key: lenz, value: 4.6
key: name, value: Door#1
key: onclick, value: animate("angle", 0, 120.0) -
@garry k said:
I run this code on one of my doors
` model = Sketchup.active_model
definitions = model.definitionsdefinitions.each{ |defs|
dicts = defs.attribute_dictionaries()
next if dicts == nildicts.each{ |dict|
next if dict.name != 'dynamic_attributes'
puts '', "dictionary: #{dict.name}, definition #{defs.name}"
dict.each_pair{ |key, value|
puts "key: #{key}, value: #{value}"
}
}
}`dictionary: dynamic_attributes, definition 96 mm Wire Pull
key: _description_label, value: Description
key: _formatversion, value: 1.0
key: _has_movetool_behaviors, value: 0.0
key: _lastmodified, value: 2014-03-13 08:29
key: _lengthunits, value: CENTIMETERS
key: _name, value: 96 mm Wire Pull
key: description, value: Cabinet Pull for 96 mm drillingdictionary: dynamic_attributes, definition Door#1
key: _lengthunits, value: CENTIMETERS
key: _rotz_formula, value: angle
key: angle, value: 0
key: lenx, value: 40.0
key: leny, value: 76.8
key: lenz, value: 4.6
key: name, value: Door#1
key: onclick, value: animate("angle", 0, 120.0)
Garry, thank you. You are a lifesaver. This would make a nice little plugin. You should at least consider posting this in 'Code Snippets' in the developers forum. I'm sure it would be appreciated. -
Thanks Philip - my latest plugin is over 8000 lines of code.
By comparison this just seems like an exercise.I saw your post and then I put threw this together from scratch.
What I should say is this only works for component definitions which is what DC's are all about.
You might want to also look at other dictionaries. -
@garry k said:
Thanks Philip - my latest plugin is over 8000 lines of code.
By comparison this just seems like an exercise.I saw your post and then I put threw this together from scratch.
What I should say is this only works for component definitions which is what DC's are all about.
You might want to also look at other dictionaries.Garry, you are too modest. Not taking away from your GREAT plugin GKWare Cabinet Maker, sometimes a short script is all that is needed to fill a void. There is nothing more valuable than the one that 'does the trick' when you need it.
Most users are not coders. There is no equivalent native SU report. Dynamic Components are not that well documented for the new user. Your script (it needs a name) makes tracking and changing formulas in DCs much easier for us amateurs: we can paste results in any text editor and print what we need! It streamlines the learning process (priceless!). So again, for all of us that will benefit from this, thank you. You rock!
Advertisement