get distance in meters maxscript

2019-07-31 09:34发布

Is there a way to get distance between two objects in meters?

I'm trying this right now

        units.displayType =#metric
        myDistance = distance aObject1 aObject2

        label1.text = distance  as string

Of course this is giving me the distance between those objects but in units of 3dsmax...

So if anyone knows a way or a formula i will be really grateful thank you

1条回答
smile是对你的礼貌
2楼-- · 2019-07-31 10:07

There is a whole topic in maxscript help dedicated to this, Units Struct - Accessing System and Display Units

The piece of code you need would look like this:

label1.text = units.formatValue myDistance
查看更多
登录 后发表回答