// =========================================================================== // 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: August 14, 1996 // // Description: // Create text using the option box defaults. // // Input Arguments: // The string. // // Return Value: // None. // global proc textCurvesSet( int $dohistory, int $dohow, string $dofont, string $text ) { string $textDag[], $letters[], $curves[]; string $results, $tmp[], $name, $tmpCmd; int $i, $n; int $historyOnTextCurvesNeeded = 0; // replace any \ by \\ and " by \" in the string so that the command will // create the \ and " as well // string $totalText = substituteAllString( $text, "\\", "\\\\" ); $totalText = substituteAllString( $totalText, "\"", "\\\"" ); string $cmd = "textCurves -ch " + $historyOnTextCurvesNeeded + " -f \"" + $dofont + "\" -t \"" + $totalText + "\""; if ( catch( $textDag = evalEcho($cmd) ) ) { // if textCurves failed then no need to continue since nothing was // created return; } if( ! $dohow ) { select -r $textDag[0]; return; } $letters = `listRelatives -c $textDag[0]`; float $tol = `optionVar -q positionalTolerance`; $n = size( $letters ); for( $i=0; $i<$n; $i++ ) { $name = ("Trim " + $letters[$i] + " #"); $tmpCmd = "planarSrf -name \"" + $name + "\" -ch " + $dohistory + " -tol " + $tol + " -o on -po " + ($dohow == 2) + " " + $letters[$i]; $tmp = evalEcho( $tmpCmd ); if( "" == $results ) { $results = `group -n ("Trim " + $textDag[0] + " #") $tmp[0]`; } else { parent $tmp[0] $results; } } if( ! $dohistory ) { delete $textDag[0]; } select -r $results; }