Notifications
Clear all

[Closed] Unload macroscript from memory

I can load macroscripts with the macros.load() and then the macroscript can be found under customize > macroscript-category. When I alter contents of macroscripts, this is the way I reload without restarting max.

But how can I unload a macro?

3 Replies

you can unload (actually delete) registered macro but only via SDK

Do you happen do have any solution that you can share?
Forgive me my amateurish wording: would this be an extension that can be called from maxscript, like a command, ie unloadMacro “macroname” “category”, where unloadMacro is the solution done in SDK?

With actually delete, will it delete the file as well you mean?

this one will make your macro unavailable in current max session, but the .mcr file will remain on disk (it will be available again on max restart)

g = (dotNetClass "Autodesk.Max.GlobalInterface").Instance

action_table = g.coreinterface.ActionManager.GetTable 82 -- Macro Scripts
your_action  = action_table.GetAction 12345 -- your macro index
action_table.DeleteOperation your_action