Finding unit of drawing in options
-
Hello !
How can I find unity of the drawing in ruby ??? (mm cm inch, etc...)
Thank you !!
-
Hi,
Try this one :-def get_current_unit_(a)
case Sketchup.active_model.options[0][2]
when 0
return a.to_inch
when 1
return a.to_feet
when 2
return a.to_mm
when 3
return a.to_cm
when 4
return a.to_m
end
endOscar
-
Ok !!
I tried to find a system to allow the same thing, but I was not expecting something like this!
Thank you! It will greatly help me! -
-
Hi Mattt,
I think, I misunderstand what the title already!
"a" is the value of any numeric input.
Oscar
-
I believer Matt Frenglish is trying to ask how to get the units of the drawing.

j'espere que ne te casse pas les pieds, Matt666! -
@fletch said:
I believer Matt Frenglish is trying to ask how to get the units of the drawing.

j'espere que ne te casse pas les pieds, Matt666!Then, try this
def get_current_unit ()
case Sketchup.active_model.options[0][2]
when 0
return "inch"
when 1
return "feet"
when 2
return "mm"
when 3
return "cm"
when 4
return "m"
end
end -
@fletch said:
j'espere que ne te casse pas les pieds, Matt666!
No !! 
@unknownuser said:
I believer Matt Frenglish is trying to ask how to get the units of the drawing.
absolutely!
@unknownuser said:
Frenglish

@unknownuser said:
Then, try this
def get_current_unit ()
case Sketchup.active_model.options[0][2]
when 0
return "inch"
when 1
return "feet"
when 2
return "mm"
when 3
return "cm"
when 4
return "m"
end
endThank you !!

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