Skip to content
Tags

,

MEL: Remove objects from sets

by nikos on May 16th, 2011

One can only wonder why Autodesk has never added a simple command to the standard menus for removing objects from sets. Instead the normal user has to go through the Relationship Editor to remove objects. Here’s a command that simplifies the process.

Usage: removeFromSet
Make sure you have selected at least one object and a set

proc removeFromSet() {
    string $objectSets[] = `ls -sl -type objectSet`;
    string $selection[] = `ls -sl`;
    $selection = stringArrayRemove( $objectSets, $selection );
    for ( $set in $objectSets ) {
        for ( $sel in $selection ) {
            if ( `sets -im $set $sel` ) {
                sets -rm $set $sel;
            }
        }
    }
}

From → MEL

No comments yet

Leave a Reply

You must be logged in to post a comment.