The user selected robot setting “Units Selection” should be available in the API. That will make the end user capable of making the selection ones, and afterwards all polyscope values will be in the selected units.
Thank you for the feature request, @OnRobot_ebbe
Note: Other users that find the feature request relevant to themselves might “like” the post or provide their own alternate use case below.
Having just encountered the need, I’d like to second this request on unit selection from script.
Same here.
Is there any workaround now to know if user have selected metric or U.S Customary?
There is no workaround.
However you might use Java getLocale to read the local language settings.
However if the robot is running “English” it could be quite hard to determine the units.
In your plugin though, the workaround could be to create a radio button for the user to choose.
Check out the new 3.5 release, this feature have now been implemented.
Release of 3.5