Notifications
Clear all

[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 !

9 Replies

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]
1 Reply
(@selectin)
Joined: 11 months ago

Posts: 0

You can use the following code:

macroScript Object_Buttom_up 
(
	if $ != undefined 	then
	(		
		CenterPivot $	

		$.pivot.z = $.min.z
	)
	else
	(
		MessageBox "请选择一个对象"
	)
)

i like this one. btw … is it good or bad?

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?

1 Reply
(@gazybara)
Joined: 11 months ago

Posts: 0

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]	
 	)
 )

BTW Did I wrote symbols right or wrong?

1 Reply
(@selectin)
Joined: 11 months ago

Posts: 0

very exactly! Are you live in HongKong? May I be your friend? My e-mail is @163.com” data-bbcode=”true”>neural_network@163.com. I am looking forward to receiving your letter.

I live in Central Europe, Distance between Hong Kong and Niš (my city)
is [8514 km = 5290 miles]

so fun! :bounce: was it the Serbia? Nice to meet you on the CGTALK.