// =========================================================================== // 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. // =========================================================================== // // Description : // A utility script. // global proc string appendToCmdPlaceHoldersForSelectionItems( string $cmd, int $nargs ) // // Description : // Say the cmd expects n selection items. The proc here // appends %1 %2 ... %n as place holders in to the string // $cmd. // // For example : intersect expects two selection items. // We have the cmd : "intersect -ch true -fs 0" // After the call : "intersect -ch true -fs 0 %1 %2 ;" // // Subsequently use // executeCmdOnItems( $cmd, $items). // { string $tmpCmd = $cmd ; int $i ; for( $i = 0 ; $i < $nargs ; $i++ ) { $tmpCmd += " %$i" ; } $tmpCmd += " ;" ; return $tmpCmd ; }