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


Basing on this thread’s understanding, I think we need always write data with inch unit format to skethup files.!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);


Have a look at SUOptionsProviderSetValue.

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


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


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


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.

0–>inch (default)

best regards