// =========================================================================== // 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: May, 1997 // // Description: // dynExecuteGoalCommand executes the goal command // // Input Arguments(): // string $goalCmd -- the goal command string (except for the selection) // // Return Value: // None. // // // ============== dynExecuteGoalCommand ============== // // SYNOPSIS // Execute the goal command. // The last item in the selection list is the goal, and all // other items are attracted to it. // global proc dynExecuteGoalCommand(string $goalCmd) { string $fullCmd; int $numParticleObjs; int $i; string $selected[] = `ls -sl`; $numParticleObjs = size($selected) - 1; $fullCmd = $goalCmd + " -g " +$selected[$numParticleObjs] + " "; for ($i = 0; $i < $numParticleObjs; $i++) $fullCmd = $fullCmd + " " + $selected[$i]; evalEcho($fullCmd); }