// =========================================================================== // 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: 4 Dec 1996 // // Description: // These procs create the controls for a common modelling tolerances in // the property sheets and attribute windows. // // Input Arguments: // string $parent // string $node // string $positionalTolerance IF you want a positional tolerance wiget "showPositionalTolerance" // string $tangentTolerance IF you want a tangent tolerance wiget "showTangentTolerance" // string $curvatureTolerance IF you want a curvature tolerance wiget "showCurvatureTolerance" // // Return Value: // None. // // // Description: // Connect the controls for all of the controls in the commonToleranceProperties dialog. // // global proc commonToleranceHistoryLink( string $parent, string $node, string $positionalTolerance, string $tangentTolerance, string $curvatureTolerance ) { setParent $parent ; if ($positionalTolerance == "showPositionalTolerance") { // c(0) tolerance. // connectControl commonPositionalTolerance($node + ".pt"); } if ($tangentTolerance == "showTangentTolerance") { // g(1) tolerance. // connectControl commonTangentTolerance($node + ".tt"); } if ($curvatureTolerance == "showCurvatureTolerance") { // g(2) tolerance. // connectControl commonTangentTolerance($node + ".ct"); } } // // Description: // Set the callbacks for all of the controls in the commonToleranceProperties dialog. // In simple terms show or hide tolerance stuff based on what is required by the tool // // global proc commonToleranceValues( string $parent, string $showSpecificTolerances, string $showPositionalTolerance, string $showTangentTolerance, string $showCurvatureTolerance) { setParent $parent; // Should any tolerances be shown, If so pop that tab foward, else hide all the tolerance stuff if ($showSpecificTolerances == "showSpecificTolerances") { tabLayout -e -selectTab dontShowTolerance_Tab specificTolerance_Tabs; radioButtonGrp -e -on1 ("tabLayout -e -selectTab dontShowTolerance_Tab specificTolerance_Tabs;") -on2 ("tabLayout -e -selectTab showTolerance_Tab specificTolerance_Tabs;") commonToleranceOptions; // Should position tolerance be shown, If so pop that tab foward, // else hide postion the tolerance stuff if ($showPositionalTolerance == "showPositionalTolerance") { tabLayout -e -selectTab showTolerancePosition_Tab tolerancePosition_Tabs; } else { tabLayout -e -selectTab dontShowTolerancePosition_Tab tolerancePosition_Tabs; } // Should tangent tolerance be shown, If so pop that tab foward, // else hide tangent the tolerance stuff if ($showTangentTolerance == "showTangentTolerance") { tabLayout -e -selectTab showToleranceTangent_Tab toleranceTangent_Tabs; } else { tabLayout -e -selectTab dontShowToleranceTangent_Tab toleranceTangent_Tabs; } // Should Curvature tolerance be shown, If so pop that tab foward, // else hide Curvature the tolerance stuff if ($showCurvatureTolerance == "showCurvatureTolerance") { tabLayout -e -selectTab showToleranceCurvature_Tab toleranceCurvature_Tabs; } else { tabLayout -e -selectTab dontShowToleranceCurvature_Tab toleranceCurvature_Tabs; } } else { tabLayout -e -selectTab dontShowTolerance_Tab specificTolerance_Tabs; radioButtonGrp -e -on1 ("tabLayout -e -selectTab dontShowTolerance_Tab specificTolerance_Tabs;") -on2 ("tabLayout -e -selectTab showTolerance_Tab specificTolerance_Tabs;") commonToleranceOptions; } } // // Description: // This procedure builds the standard modeling tolerances but by // default none of them are shown. If your procedure needs them // use the commonToleranceValues procedure passing // IF you want a positional tolerance wiget pass in "showPositionalTolerance" // IF you want a tangent tolerance wiget pass in "showTangentTolerance" // IF you want a curvature tolerance wiget pass in "showCurvatureTolerance" // global proc commonToleranceProperties( string $parent, string $node, string $positionalTolerance, string $tangentTolerance, string $curvatureTolerance ) { setParent $parent; setUITemplate -pushTemplate DefaultTemplate; frameLayout -l "Tolerances" -borderVisible false -labelIndent 20 commonTolerance_Frame; columnLayout commonTolerance_Column; radioButtonGrp -nrb 2 -l (uiRes("m_commonToleranceProperties.kUseTolerance")) -l1 (uiRes("m_commonToleranceProperties.kGlobal")) -l2 (uiRes("m_commonToleranceProperties.kLocal")) -select 1 commonToleranceOptions; tabLayout -childResizable true -tabsVisible false specificTolerance_Tabs; columnLayout dontShowTolerance_Tab; setParent ..; columnLayout -adj true showTolerance_Tab; tabLayout -childResizable true -tabsVisible false tolerancePosition_Tabs; columnLayout -adj true dontShowTolerancePosition_Tab; setParent ..; columnLayout -adj true showTolerancePosition_Tab; separator -style "none" -h 1; floatSliderGrp -l (uiRes("m_commonToleranceProperties.kPositional")) -min 0.0001 -max 1.0 -fmn 0.00001 -fmx 1000.0 commonPositionalTolerance; setParent ..; setParent ..; tabLayout -childResizable true -tabsVisible false toleranceTangent_Tabs; columnLayout dontShowToleranceTangent_Tab; setParent ..; columnLayout -adj true showToleranceTangent_Tab; floatSliderGrp -l (uiRes("m_commonToleranceProperties.kTangent")) -min 0.0001 -max 1.0 -fmn 0.00001 -fmx 1000.0 commonTangentTolerance; setParent ..; setParent ..; tabLayout -childResizable true -tabsVisible false toleranceCurvature_Tabs; columnLayout dontShowToleranceCurvature_Tab; setParent ..; columnLayout -adj true showToleranceCurvature_Tab; floatSliderGrp -l (uiRes("m_commonToleranceProperties.kCurvature")) -min 0.0001 -max 1.0 -fmn 0.00001 -fmx 1000.0 commonCurvatureTolerance; setParent ..; setParent ..; setParent ..; setParent ..; setParent ..; setParent ..; setUITemplate -popTemplate; commonToleranceValues( $parent, "showSpecificTolerances", $positionalTolerance, $tangentTolerance, $curvatureTolerance); commonToleranceHistoryLink ($parent, $node, $positionalTolerance, $tangentTolerance, $curvatureTolerance); }