/* ajhSmartExtrude.mel - version 1.0 Alex Hogan - www.alexhogan.com - March 16, 2003 This script should execute extrude edge or extrude face based on what you have selected. A future version will have more error checking and better error handling. */ global proc ajhSmartExtrude() { $selectionList = `ls -sl`; // grab the selection $selectionSize = size( $selectionList ); string $firstObject; // get the first object $firstObject = $selectionList[0]; $newSelection = `filterExpand -sm 32 -sm 34`; // filter the selection to edges and faces select -r $newSelection; if ( `gmatch $firstObject "*.f*"` ) // if the first object is a face, extrude face { $newExtrudeNode = `polyExtrudeFacet`; string $newSelection[]; $newSelection = `ls -sl`; select -cl; select $newSelection; //gotta clear and reselect to make sure the gizmo works select -tgl $newExtrudeNode; ShowManipulators; //show the gizmo } else if ( `gmatch $firstObject "*.e*"` ) // if the first object is an edge, edtrude edge { $newExtrudeNode = `polyExtrudeEdge`; string $newSelection[]; $newSelection = `ls -sl`; select -cl; select $newSelection; //gotta clear and reselect to make sure the gizmo works select -tgl $newExtrudeNode; ShowManipulators; //show the gizmo } }