// =========================================================================== // 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 string makeNewPanel(string $panelType, string $scriptedType, string $destPanel) // // Description: // This proc will make a new panel of the specfied type and place // where the $destPanel is currently positioned. // { int $nPanels; string $newPanel; // create new panel // if ("scriptedPanel" == $panelType) { $newPanel = `eval ($panelType +" -p $gMainPane -type "+ $scriptedType)`; } else { $newPanel = `eval ($panelType + " -p $gMainPane;")`; } eval ($panelType + " -e -rp " + $destPanel + " -label \"" + (localizedPanelLabel(interToUI($newPanel))) + "\" " + $newPanel); // add prefs // $nPanels = `optionVar -q numPanels`; optionVar -sv ("panelType" + $nPanels) $panelType -sv ("panel" + $nPanels) $newPanel -sv ("panelLabel" + $nPanels) `interToUI $newPanel` -sv ("panelCreate" + $nPanels) ($panelType + " -unParent " + $newPanel) -sv ("panelPreCond" + $nPanels) ("exists " + $panelType) -iv ("panelLoad" + $nPanels) true; $nPanels++; optionVar -iv numPanels $nPanels; return $newPanel; }