Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Simple Popup Message Box Macro Script (error!)

Simple Popup Message Box Macro Script (error!)

utku.demirZFGQ5
Participant Participant
1,020 Views
2 Replies
Message 1 of 3

Simple Popup Message Box Macro Script (error!)

utku.demirZFGQ5
Participant
Participant

Hello Dear All,

 

I'm pretty rookie about Max scripting (trying to learn) so simple I wish to script that: if object/s not selected > show message box or if something currently selected give that amounts for uvw! 

I tried as you can see here:
1.png










But I'm getting that error:

2.png




How can I solve this?

Best Regards

 

Here code itself:

 

macroScript Macro5
category:"DragAndDrop"
toolTip:""

if selection.count == 0 then messagebox "please select an object first!" title:""
else
modPanel.addModToSelection (Uvwmap ()) ui:on
$.modifiers[#UVW_Map].utile = 20
$.modifiers[#UVW_Map].vtile = 20
$.modifiers[#UVW_Map].wtile = 20

0 Likes
Accepted solutions (1)
1,021 Views
2 Replies
Replies (2)
Message 2 of 3

a2d4f3s1
Enthusiast
Enthusiast
Accepted solution

In this case, you can write it like this:

macroScript Macro5
category:"DragAndDrop"
toolTip:""
(
	if selection.count == 0 then
	(
		messagebox "please select an object first!" title:""
	) else (
		modPanel.addModToSelection (Uvwmap ()) ui:on
		$.modifiers[#UVW_Map].utile = 20
		$.modifiers[#UVW_Map].vtile = 20
		$.modifiers[#UVW_Map].wtile = 20
	)
)
Message 3 of 3

utku.demirZFGQ5
Participant
Participant

Thank you very much @a2d4f3s1, script working well now, for the sake of learning that bracket )()) logic (Syntax Definitions) I will check MaxScript Help website from Autodesk!

0 Likes