// =========================================================================== // 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. // =========================================================================== // Description: This procedure opens the specified newPanel in // the given panel specified by the panelName. // If the newPanel was originally showing in a tear off window, // then we close the window, and show the newPanel in the // given panel location. // global proc hyperGraphReplacePanel(string $panelName, string $newPanel) { // Check if the newPanel already existed in a tear off window. // if (`panel -query -tearOff $newPanel`) { // Figure out which window contains the newPanel. // string $panelControl = `panel -query -control $newPanel`; string $windowName = match("^[^|]*",$panelControl); // Close the window. // global int $gKeepHyperGraphWhileClosingWindow; $gKeepHyperGraphWhileClosingWindow = true; deleteUI $windowName; } scriptedPanel -edit -replacePanel $panelName $newPanel; }