PDA

View Full Version : Worl units convertion


thrischan
03-18-2005, 08:20 PM
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.

Bobo
03-18-2005, 08:50 PM
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.

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.SystemType
#inches

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:
units.formatValue 1
"0.0254m"

thrischan
03-18-2005, 09:03 PM
You are right thank you very much!!

CGTalk Moderation
03-18-2005, 09:03 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.