Message 1 of 10
Problem with deleting all Helper Objects

Not applicable
11-16-2012
05:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey everybody,
when I import STEP files, I get a nice hierarchy of the assembly with helpers and stuff.
But i don't need all this and want to delete all helpers automatically by script.
The button for this looks like this:
When I press the button I get the following error:
The weird thing is: When I execute just the first two lines of the button's function and then manually enter the third line - it works.
When I write it like above - it does not 😞
Just for explanation: I had to add the "unlink" inbetween because otherwise the "for"-loop wouldnt work for all dummy objects.
Thanks in advance!
when I import STEP files, I get a nice hierarchy of the assembly with helpers and stuff.
But i don't need all this and want to delete all helpers automatically by script.
The button for this looks like this:
on btnHelper pressed do
(
actionMan.executeAction 0 "40021" -- Selection: Select All
max unlink
for i in objects where superclassOf i == Helper do delete i
)
When I press the button I get the following error:
-- Error occurred in btnHelper.pressed(); filename: C:\Users\mediauser\AppData\Local\Autodesk\3dsMax\2013 - 64bit\ENU\usermacros\DragAndDrop-Macro4.mcr; position: 1734; line: 39
-- Frame:
>> MAXScript Rollout Handler Exception:
-- Unknown system exception <<
The weird thing is: When I execute just the first two lines of the button's function and then manually enter the third line - it works.
When I write it like above - it does not 😞
Just for explanation: I had to add the "unlink" inbetween because otherwise the "for"-loop wouldnt work for all dummy objects.
Thanks in advance!