Notifications
Clear all

[Closed] Activate/toggle tool with maxscript

In this specific case I’m looking for a way to activate the “Select and Link” tool through maxscript. Does there exist a way to toggle this tool through maxscript, or would I have to somehow “click the button” through maxscript?

I’m also curious as to how you would approach these kinds of challenges in general. I know that some buttons are exposed in maxscript as a command (snapMode.active for example), but how do you go about actually finding the command?

1 Reply

you can make yourself a helper dialog to lookup for action items and then toggle them using actionMan
there’s an example in mxs reference Interfaces > Core Interfaces > actionMan

alternatively if you know the ID of the command mode you can push it directly using .net or python sdk

g = (dotNetClass "Autodesk.Max.GlobalInterface").Instance
format "--> %\n" toolMode.CommandModeID
g.CoreInterface7.PushStdCommandMode 100 -- select and link 
format "--> %\n" toolMode.CommandModeID