// =========================================================================== // 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: 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; } }