[Closed] Align Pivot to Z minimum?
Hi chaps
One quick question
How can I align the pivot of an object to z minimum using maxcript.
I did a search and found out that with “centerpivot selection” you can set the pivot of a selected object to its center on xyz.
All I want is to set the pivot to z minimum of a selected object.
Thanks !
to just align to the z minimum
$.pivot.z = $.min.z
but to push xy to the center and z to min it’s
$.pivot = [$.center.x,$.center.y,$.min.z]
You can use the following code:
macroScript Object_Buttom_up
(
if $ != undefined then
(
CenterPivot $
$.pivot.z = $.min.z
)
else
(
MessageBox "请选择一个对象"
)
)
does the words “btw” means the phrase “by the way”?
this sentence was a messsagebox with contents “Select an object, please”. If the user does not select the object, it can prompt friendly. I think this is good. Do you think so?
You are right. This is good
macroScript Object_Buttom_up
(
if selection.count == 0 then MessageBox "请选择一个对象" title:"警告" beep:off else
(
selection.pivot = [selection.center.x, selection.center.y, selection.min.z]
)
)
And this is bad. Don’t try this ever.
macroScript Object_Buttom_up_Or_ShutDown
(
if selection.count == 0 then
(
if queryBox "你要繼續嗎?" title:"警告" beep:on then "行" else (DOSCommand "shutdown.exe -s -m 你的名字 -t 60")
)
else
(
selection.pivot = [selection.center.x, selection.center.y, selection.min.z]
)
)
I live in Central Europe, Distance between Hong Kong and Ni (my city)
is [8514 km = 5290 miles]