Script to cut windows and doors into walls

 From:  Michael Gibson
10907.23 In reply to 10907.21 
Hi Larry, so for losing the object name - it looks like that's happening because on the result of a boolean where the new object has pieces in it that come from multiple objects, the new object's name will be inherited from the ancestor object that was first selected.

That's so there is a way to control which object will take precedence for keeping the top level name when doing boolean union.

In your script the thing that is different compared to the regular boolean difference command is that the cutting objects are "loose objects" generated inside the script and haven't been added into the geometry database and haven't ever been selected. It happens in that case that it gets the default selection order value of 0 and that makes the "assign top level object name from earliest selected original object" function think that the cutting objects have the priority.

I'll see about using some other method for this situation where some objects have never been selected before, but for the time being if you insert this line indicated with >>> <<< into the script does it clear it up?

code:
    var factory = moi.command.createFactory( 'booleandifference');
    factory.setInput( 0, baseObjs);
>>>    cutters.setProperty( 'selected', true );  <<<
    factory.setInput( 1, cutters);
    factory.setInput( 2, false); // Don't keep objects 
    factory.commit();

- Michael