How to set sketchup file's display length unit via C API


#1

Basing on this thread’s understanding, I think we need always write data with inch unit format to skethup files.
https://groups.google.com/forum/#!searchin/su-sdk-fileshare/set$20model$20unit/su-sdk-fileshare/pTL1Jtjbvvs/9WUdO2vpo3IJ

And the question here is can we set the display unit to not inch but other supported formats? like center meters?
I know there is a C API to retrieve the display unit of current model, but seems we don’t have a setter API for this.

SU_RESULT SUModelGetUnits(SUModelRef model, enum SUModelUnits* units);

#2

Have a look at SUOptionsProviderSetValue.
http://www.sketchup.com/intl/en/developer/su-api/options__provider_8h.html#a85f7b6608658a47f4ca3298c2ea48b1b

The docs for SUOptionsProviderGetValue has reference info on what values to use.


#3

It does work to set the display length unit by such way. Thank you.


#4

We have same issue. if possible, please re-link this URL for me. or please share me any information.


#5

Inspite of you did set with"OptionsProvider" and got and changed “unit” such as “mm”, but we did NOT find that “inch” couldn`t change to “mm”.

We can change “unit” except “inch”.
If you know how to change “unit”, from “inch” to “mm”, please notice me asap.

ref)
0–>inch (default)
1–>feet
2–>mm
3–>cm
4–>m

best regards
sp_kim