// =========================================================================== // 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. // =========================================================================== // // // Creation Date: April 3, 1997 // // // Description: // The duplicateSurfacePreset() procedure executes one or more duplicateSurface // operations based on the duplicate Surface option vars. In general if // you have n surface on surface shapes selected, n operations would be // carried out. // // Input Arguments: // None. // // Return Value: // None. // global proc duplicateSurfacePresetArgList( string $version, string $args[] ) // // Description : // Proc to do one or more duplicateSurface ops depending on number // of valid selection items. // { int $doHistory, $local; $doHistory = $args[0]; $local = $args[1]; //--------------------------------------- // put together a duplicateSurface cmd. //--------------------------------------- // string $cmd = "duplicateSurface" + " -ch " + $doHistory + " -local " + $local + " "; //---------------------------------------- // place holders for 1 selection items. //---------------------------------------- // int $nitems = 1 ; $cmd = appendToCmdPlaceHoldersForSelectionItems($cmd,$nitems) ; //--------------------------------------------- // Get the list of nurbs surfaces in select list. //--------------------------------------------- // global int $gSelectNurbsFaces; string $surfaceList[] = `filterExpand -ex false -sm $gSelectNurbsFaces`; int $surfaceCount = size($surfaceList) ; //-------------------------------------------- // Valid # of items. //-------------------------------------------- // if( $surfaceCount < 1 ) { error (uiRes("m_duplicateSurfacePresetArgList.kDupNurbsNoValidObject")); } else { // all n. string $duplicateResults[] ; int $i ; string $single[1]; for( $i = 0 ; $i < $surfaceCount ; $i++ ) { $single[0] = $surfaceList[$i]; string $results[] = executeCmdOnItems( $cmd,$single ); $duplicateResults = stringArrayCatenate( $duplicateResults, $results ); } // select the results. // int $resultCount = size($duplicateResults) ; if( $resultCount > 0 ) { global int $gSelectNurbsSurfacesBit; string $selectString; $selectString = "select -r "; // select all including DG nodes. // $resultCount = size($duplicateResults) ; for( $i = 0 ; $i < $resultCount ; $i++ ) { $selectString += $duplicateResults[$i] ; $selectString += " "; } $selectString += ";"; select -cl ; eval($selectString) ; } } }