// =========================================================================== // 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 8, 1997 // // Description: // The freeFormFilletPreset() procedure executes one freeFormFillet operation // on curve on surface shapes based on the option vars. // // Input Arguments: // None. // // Return Value: // None. // proc string pieceTogetherCmd( int $doHistory, int $asPolygons, float $depth, float $bias, float $posTol, float $tanTol ) // // Description : // Put together a freeFormFillet Cmd. // { string $cmd = "freeFormFillet" ; // history. // $cmd += (" -ch " + $doHistory); // curve range. // Why ? manips are goind to come up anyway. // //$cmd = $cmd + " -rn " ; //if( $curvePartial == 1 ) $cmd = $cmd + "true" ; //else $cmd = $cmd + "false" ; // polygon output. // $cmd += (" -po " + $asPolygons); // depth. // $cmd += (" -depth " + $depth); // bias // $cmd += (" -bias " + $bias); // pos Tol // $cmd += (" -pt " + $posTol); // tan Tol // $cmd += (" -tt " + $tanTol); return $cmd ; } global proc freeFormFilletPreset( int $doHistory, int $asPolygons, float $depth, float $bias, float $posTol, float $tanTol ) // // Description : // Proc to do one freeFormSurfaceFillet depending on number // of valid selection items. // { global int $gSelectSurfaceEdgeBit ; global int $gSelectMeshesBit ; global int $gSelectCurvesOnSurfacesBit; global int $gSelectNurbsSurfacesBit; global int $gSelectIsoparmsBit; //--------------------------------------- // put together an extrude cmd. //--------------------------------------- // string $cmd = pieceTogetherCmd( $doHistory, $asPolygons, $depth, $bias, $posTol, $tanTol ) ; //---------------------------------------- // place holders for 2 selection items. //---------------------------------------- // int $nitems = 2 ; $cmd = appendToCmdPlaceHoldersForSelectionItems($cmd,$nitems) ; //--------------------------------------------- // Get the list of cos in select list. // isoparms, cos, NURBS surface Edges. //--------------------------------------------- // string $curveList[] = `filterExpand -ex true -sm $gSelectCurvesOnSurfacesBit -sm $gSelectIsoparmsBit -sm $gSelectSurfaceEdgeBit`; //-------------------------------------------- // Valid # of items. //-------------------------------------------- // int $curveCount = size($curveList) ; if( $curveCount < 2 ) { error (uiRes("m_freeFormFilletPreset.kFreeFormFilletInvalSelection")); } else { if( $curveCount > 2 ) { warning (uiRes("m_freeFormFilletPreset.kFreeFormFilletTooManyArgs")); } string $filletPair[2]; $filletPair[0] = $curveList[$curveCount-2]; $filletPair[1] = $curveList[$curveCount-1]; string $filletResults[] ; int $nr = size($filletResults) ; $filletResults = executeCmdOnItems($cmd,$filletPair); // select the results. // int $resultCount = size($filletResults) ; if( $resultCount > 0 ) { string $selectString = "select -r "; $resultCount = size($filletResults) ; for( $i = 0 ; $i < $resultCount ; $i++ ) { $selectString += $filletResults[$i] ; $selectString += " "; } $selectString += ";"; eval($selectString) ; } } }