Changing units format via ruby
-
is there a way to change the unit format via ruby?
[say i'm set to architectural -> feet but i want to switch it to decimal -> inches]
and while i'm at it, how about a way to switch the precision as well?
thanks
-
Yes there is - you can control both those and the 'snapping' to.
There's a tool to swap units - Toggle-Units...
http://forums.sketchucation.com/viewtopic.php?p=81391#p81391 -
oh right, i have that plugin.
basically though, what i'm wondering, is if there is something i can type into the ruby console to do this..
(apparently there is since that plugin was made but it would take me 3 days to dissect the code and figure out what to type into the console
)i've looked through the api documentation but apparently i missed the part dealing with units.
thanks -
The units part of the API is well hidden away!
Here's a 'mm' version BUT you can see how to do in 'inches' one...
` Sketchup.active_model.options["UnitsOptions"]["LengthUnit"]=2mm`
OR use 0=inch, 1=feet etc...
` Sketchup.active_model.options["UnitsOptions"]["LengthSnapEnabled"]=truegrid snap on
Sketchup.active_model.options["UnitsOptions"]["LengthSnapLength"]=10.mm
or whatever
Sketchup.active_model.options["UnitsOptions"]["LengthPrecision"]=1
1.5mm not 2mm or 2.01mm
Sketchup.active_model.options["UnitsOptions"]["SuppressUnitsDisplay"]=true
don't show 'mm' etc
Sketchup.active_model.options["UnitsOptions"]["LengthFormat"]=0
Decimal`
OR use =3 for fractional, =2 for Engineering, =1 for Architectural...
-
sweet!
exactly what i was looking for.
thank you sir
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement