Search code examples
rubysketchup

How to read lenX from a SketchUp Dynamic Component on Ruby?


I have determined my component has an attribute with key 'lenx' using some code from http://www.sketchup.com/intl/en/developer/docs/tutorial_attrreporting

But reading dynamic_attributes (from Dynamic Components) is not making any sense.

When I select the component and run the following code the numbers returned are weird.

Dictionary_name = "dynamic_attributes"
mod = Sketchup.active_model # Open model
fsel = mod.selection.first # first selected object 
lengthix = fsel.get_attribute Dictionary_name, "lenx"

enter image description here


Solution

  • Eureka. The numbers returned are in Inches, even if the model is set to Meters and the DC parameters are set to Centimeters.