Notifications
Clear all

[Closed] Worl units convertion

Hi everybody,

I hope you could help me with a problem i having:

How can i convert a generic units value to metric units or custom.

2 Replies
1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

See the Units structure documentation in the MAXScript Reference by typing “units” in the Index tab. Especially see units.SystemScale and units.SystemType.

So if you have Max set to 1 GU = 1 inch in the System Units Settings, the results would be:

units.SystemScale
1.0
units.[b][b]SystemType
#inches

[/b][/b]To convert a GU value to the Display units, you could pass for example 1 generic unit to the units.formatValue() function and you will get back a string containing the conversion result:
[b][b]units.formatValue 1
“0.0254m”

[/b][/b]

You are right thank you very much!!