Yep. In my mind, when I set format, unit, and precision of model’s LengthFormatter just shown as my code segment, the units part in model info panel of the opening .skp file will be amended as the above image. However, after I execute the code with .skp file, the units part in model info panel is not changed, and the model info panel always automatically popup…
My goal:
Format: Decimal
UnitType: cm
Precision:0.000000cm
Enable length snapping: Checked 0.000001cm
Display units format: Checked
Length formatters are used to generate formatted strings (optionally with units) from length, area, and volume values. Additionally length formatters can be used to translate a formatted length/area/volume string into a value. Accessors and setters are exposed for some of the key formatting properties, facilitating customization of the formater. In cases when users want the formatter to reflect the properties of a model, SUModelGetLengthFormatter should be used to more efficiently extract/copy the relevant properties from the model to the formatter.
In order to set units, which are part of the model’s options, you’ll need to access the model’s OptionsManager and OptionsProvider collections.
The keyname for the units options provider is: "UnitsOptions".
Within SketchUp, you can paste this Ruby snippet into the Ruby Console to see the current values assigned to the "UnitsOptions" provider’s key value pairs …
That sounds strange… are you saying the Model Info dialog automatically opens without user interaction? After opening a file you created with the C API?