// =========================================================================== // 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 29, 1997 // // Description: // The stitchSurfacePointsPreset() procedure executes one stitchSurfacePoints // operation given atleast two NURBS surfaces points, based on the option vars. // // Input Arguments: // None. // // Return Value: // None. // proc string pieceTogetherCmd( int $doHistory, int $replaceOriginal, int $ewt, int $cascade ) // // Description : // { string $cmd = "stitchSurfacePoints" ; $cmd = $cmd + " -ch " ; $cmd = $cmd + $doHistory ; $cmd = $cmd + " -rpo "; $cmd = $cmd + $replaceOriginal ; $cmd = $cmd + " -ewt " ; if( $ewt != 0 ) $cmd = $cmd + " true " ; else $cmd = $cmd + " false " ; $cmd = $cmd + " -cascade " ; if( $cascade ) $cmd = $cmd + " true " ; else $cmd = $cmd + " false " ; return $cmd ; } global proc stitchSurfacePointsPreset( int $doHistory, int $replaceOriginal, int $assignEqualWt, int $cascade ) // // Description : // { global int $gSelectEditPointsBit ; global int $gSelectSurfaceParmPointsBit; global int $gSelectSurfaceKnotsBit ; global int $gSelectCVsBit ; string $ptsList[] = `filterExpand -ex true -sm $gSelectEditPointsBit -sm $gSelectSurfaceParmPointsBit -sm $gSelectCVsBit`; int $len = size($ptsList) ; if( $len < 2 ) { error (uiRes("m_stitchSurfacePointsPreset.kInvalidSelection")) ; } else { string $cmd = pieceTogetherCmd( $doHistory, $replaceOriginal, $assignEqualWt, $cascade ) ; $cmd = appendToCmdPlaceHoldersForSelectionItems($cmd,$len) ; string $results[] = executeCmdOnItems($cmd,$ptsList); if( size($results) == 0 && ( $replaceOriginal == 1 ) && ( $doHistory == 0 )) { error (uiRes("m_stitchSurfacePointsPreset.kCmdFailed")) ; } else { global int $gSelectNurbsSurfacesBit ; int $count = size($results) ; string $selectString = "select -r "; int $i ; for( $i = 0 ; $i < $count ; $i++ ) { $selectString += $results[$i] ; $selectString += " "; } $selectString += ";"; select -cl ; eval($selectString) ; } } }