Delete Selected Objects

Delete Selected Objects

Anonymous
Not applicable
3,901 Views
4 Replies
Message 1 of 5

Delete Selected Objects

Anonymous
Not applicable

Hi, I am having an issue with a drag and drop macro I created from the listener window. In max 2012 it works correctly but in max 2014 I get an error "-- No "delete" function for undefined". This is what the macroscript looks like:

 

macroScript Macro2
category:"DragAndDrop"
toolTip:"Delete"
(
actionMan.executeAction 0 "40020" -- Edit: Delete Objects
delete $
)

 

Any ideas why the script would work fine in 2012 and not 2014?

 

Also is there anyway to rebind the "delete key" back to its default? When I couldn't get the script to work I bound ~ to delete selected and now I cannot reassign it back to the default "delete key".

 

Thanks in advance for any help.

 

 

0 Likes
3,902 Views
4 Replies
Replies (4)
Message 2 of 5

Steve_Curley
Mentor
Mentor
It won't - because both lines delete the current selection, so once the ActionMan line has executed, there is no selection (they're already deleted) for the Delete $ to work on. $ is shorthand for Selection (a built-in collection) which is empty when nothing is selected, hence the Undefined error. Use one or the other, not both. Delete Selection is probably clearer than Delete $, and I'd avoid the ActionMan commands unless there's no alternative.

As for the Delete shortcut - not easily, because the Edit field will "eat" the Delete keystroke, so you can't actually enter it. You could rename your en-us\ui\workspaces folder which will reset many customisations including the keyboard (Max will recreate it), but of course you'll lose any customisations you've made.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 3 of 5

Anonymous
Not applicable

Thanks for the reply, I tried removing the "delete$" before I posted but it still errored, but after you posted I created a new drag and drop macro but only dragged "actionMan.executeAction 0 "40020"  -- Edit: Delete Objects" from the listener window and it worked, thank you for the help. BTW I ended up using the "actionman" option cause it allows me to delete selected objects or keys from the trackbar or curve editor depending on what I am focused on, with "delete$" it deletes the object no matter what UI element I am in. 

 

As for the delete key issue do you know if it is possible to edit the .kbdx file to save from having to setup my customizations again? No biggie if there isn't a way I just thought I would ask.

 

Thanks again.

0 Likes
Message 4 of 5

Steve_Curley
Mentor
Mentor
IIRC it's an XML file, so it would be editable, but you would need to know exactly what to change. To do that you would still need to rename your existing Workspaces folder, allow max to create a new one then use a file compare to find the differences between a clean one and your old one. Problem is that because of the way the data is stored (all numbers) working out which is which could be tricky.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 5 of 5

Anonymous
Not applicable

Okay, no worries, I will just bite the bullet and redo my ui. Thanks again for the help.

0 Likes