get distance in meters maxscript

倖福魔咒の 提交于 2020-01-06 04:11:19

问题


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:


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



回答2:


It's not a actual answer , Just to Add a tip :

You can use units.formatValue(<your x,y,z value>) instead of units.formatValue myDistance



来源:https://stackoverflow.com/questions/11269434/get-distance-in-meters-maxscript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!