// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // Procedure Name: // polySelectFacePerimeter // // Description: // Select faces on the border of current selection. // Switch selection component mask to face. // // Input Arguments: // None. // // Return Value: // None. global proc polySelectFacePerimeter() { string $sel[] = `polyListComponentConversion -ff -fv -fe -fuv -fvf -tf -in`; if(size($sel) <= 0) return; $sel = `filterExpand -ex true -sm 34 $sel`; selectType -ocm -pf true; select -r $sel; PolySelectTraverse 2; string $shrinkSel[] = `ls -sl`; $shrinkSel = `filterExpand -ex true -sm 34 $shrinkSel`; string $borderFaces[] = stringArrayRemove($shrinkSel, $sel); if (`selectMode -q -object`) eval("selectType -ocm -pf true"); else eval("selectType -pf true"); select -r $borderFaces; }