// =========================================================================== // 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. // =========================================================================== global proc int stlExportOptions ( string $parent, string $action, string $initialSettings, string $resultCallback ) // // Description: // This script posts the STL file translator options. // The optionsString is of the form: // varName1=value1;varName2=value2;... // // Parameters: // $parent - the elf parent layout for this options layout. It is // always a scrollLayout. // $action - the action that is to be performed with this invokation // of this proc. Valid options are: // "query" - construct the options string and pass it // to the resultCallback. // "post" - post all the elf controls. // $initialSettings - the current options string in effect at the // time this script is invoked. // $resultCallback - // This is the proc to be called with the result string. // resultCallback ( string $optionsString ) // // Returns: // 1 if successfull. // 0 otherwise. // { int $bResult; string $currentOptions; string $optionList[]; string $optionBreakDown[]; int $index; if ($action == "post") { setParent $parent; columnLayout -adj true objTypeCol; string $on = (uiRes("m_stlExportOptions.kOn")); string $off = (uiRes("m_stlExportOptions.kOff")); radioButtonGrp -label (uiRes("m_stlExportOptions.kBinary")) -nrb 2 -cw3 175 75 75 -labelArray2 $on $off StlBinary; // Now set to current settings. $currentOptions = $initialSettings; if (size($currentOptions) > 0) { tokenize($currentOptions, ";", $optionList); for ($index = 0; $index < size($optionList); $index++) { tokenize($optionList[$index], "=", $optionBreakDown); if ($optionBreakDown[0] == "Binary") { if ($optionBreakDown[1] == "0") { radioButtonGrp -e -sl 2 StlBinary; } else { radioButtonGrp -e -sl 1 StlBinary; } } } } $result = 1; } else if ($action == "query") { if (`radioButtonGrp -q -sl StlBinary` == 1) { $currentOptions = $currentOptions + "Binary=1"; } else { $currentOptions = $currentOptions + "Binary=0"; } eval($resultCallback+" \""+$currentOptions+"\""); $result = 1; } else { $bResult = 0; } return $bResult; }