// =========================================================================== // 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: 28 June 1996 // // Description: // This is part of a set of methods for changing // a property sheet to point to a new node. // (A way of efficiently re-using existing controls) // This method re-connects a boolean control. // // Input Arguments: // The name of the existing control // The name of the new plug // The index in the control associated with the plug // // Return Value: // None // global proc AEreplaceBoolean ( string $controlName, string $plugName, string $changedCommand, int $index ) { setParent $controlName; string $buffer[]; tokenize($plugName,".",$buffer); // -queryLabel can fail for non-unique node names // string $label = ""; catch( $label = `editorTemplate -queryLabel $buffer[0] $buffer[size($buffer) - 1]` ); if( size( $label ) && `checkBoxGrp -exists valueFld` ) { eval( "checkBoxGrp -e -label" + $index + " \"" + $label + "\" valueFld" ); } // The indices of the control which are connected to plugs start at // 2 for this type of control. // int $adjustedIndex = $index + 1; connectControl -in $adjustedIndex "valueFld" $plugName; // get the list of sub-components of the checkBoxGrp, // so that we can replace the scriptJob attached to // the appropriate one. // string $subC[] = `layout -q -ca valueFld`; if ($changedCommand != "") { // create a new scriptJob for this attribute string $cmd = $changedCommand + " \"" + $buffer[0] + "\""; scriptJob -p $subC[$index-1] -rp -ac $plugName $cmd; } }