Distance from origin to pivot an object

Hi Guys

I am quite new in Mel programming and trying to write a script to create  spiral staircase. I was wondering how can I calculate the distance between pivot of highest step and the origin in order to create the middle column for stairs.

Thanks. 

Hi Alireza

try using this line of code:


xform -ws -q -piv;



It will query 6 values, you can use the first 3 of them. And that would be the position of the pivot of your object related to the world

Hope this help you (: 

Thanks a lot man!! It was very helpful :slight_smile: