My model uses mm as unit of measure. I am moving an instance of a component using the transform! function, for example as follows:
if entity.visible? then
new_transformation = Geom::Transformation.new([User_Input,0,0])
entity.transform! new_transformation
end
In the above, “User_input” is a value entered, in mm, by the user via a UI.inputbox. If the user enters “100”, this is translated to 2540 mm in my model, implying that despite the length units set in my model the Transformation is based in inches.
I can work around this by defining:
def mm(inchesIn)
mmOut=inchesIn/25.4
end
and substituting:
new_transformation = Geom::Transformation.new([mm(100),mm(0),mm(0)])
I have already tried TIG’s setup:
model.options[“UnitsOptions”][“LengthUnit”]=2
model.options[“UnitsOptions”][“LengthPrecision”]=1
model.options[“UnitsOptions”][“SuppressUnitsDisplay”]=false
model.options[“UnitsOptions”][“LengthFormat”]=0
model.options[“UnitsOptions”][“LengthSnapEnabled”]=false
it does not seem to make any difference.
How can I set the units to mm?