// Copyright (C) 1997-2014 Autodesk, Inc., and/or its licensors. // All rights reserved. // // The coded instructions, statements, computer programs, and/or related // material (collectively the "Data") in these files contain unpublished // information proprietary to Autodesk, Inc. ("Autodesk") and/or its licensors, // which is protected by U.S. and Canadian federal copyright law and by // international treaties. // // The Data is provided for use exclusively by You. You have the right to use, // modify, and incorporate this Data into other products for purposes authorized // by the Autodesk software license agreement, without fee. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. AUTODESK // DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTIES // INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF NON-INFRINGEMENT, // MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, OR ARISING FROM A COURSE // OF DEALING, USAGE, OR TRADE PRACTICE. IN NO EVENT WILL AUTODESK AND/OR ITS // LICENSORS BE LIABLE FOR ANY LOST REVENUES, DATA, OR PROFITS, OR SPECIAL, // DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK AND/OR ITS // LICENSORS HAS BEEN ADVISED OF THE POSSIBILITY OR PROBABILITY OF SUCH DAMAGES. // // // Creation Date: June 21 1997 // // // Procedure Name: // objectMoveCommand // // Description: // Move the newly created (selected) object to the correct position // // Input Arguments: // none // // Return Value: // None. // // // Utility routine // global proc objectMoveCommand() { if (!`optionVar -exists primitivePlacementRule`) { optionVar -sv primitivePlacementRule "AtOrigin" ; } string $placementRule = `optionVar -q primitivePlacementRule`; // Disable the selection pipeline to ensure the absolute move we're // about to do doesn't collapse neighbouring surfaces when global // falloff is enabled // int $softSelectEnabled = `softSelect -q -sse`; int $symmetryEnabled = `symmetricModelling -q -s`; if( $softSelectEnabled) { softSelect -e -sse 0; } if( $symmetryEnabled) { symmetricModelling -e -s 0; } switch ($placementRule) { case "AtOrigin": move 0 0 0; break; case "ViewCenter": float $pos[] = `autoPlace`; move $pos[0] $pos[1] $pos[2]; break; } if( $softSelectEnabled) { softSelect -e -sse 1; } if( $symmetryEnabled) { symmetricModelling -e -s 1; } }