// =========================================================================== // 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: Sept 9, 2005 // // Description: // This procedure searches for, and returns the menuSet object with // the given label. // global proc string findMenuSetFromLabel( string $label ) // // Description: // This proc finds a menuSet object from a given label (shown in the // drop down boxes. // // Arguments: // string $label the label of the menuSet to be found // // Return: // the name/object of the menuSet with that label, or an empty string // if there is none // { // get the list of all menuSets string $menuSets[] = `menuSet -allMenuSets`; int $i; int $menuSetSize = size($menuSets); $label = `tolower $label`; // and for each menuSet ... for ($i = 0; $i < $menuSetSize; $i++) { string $lbl = `menuSet -q -label $menuSets[$i]`; $lbl = `tolower $lbl`; // ... compare whether it is the same as the given label if ($label == $lbl) { // ... and if so, then return return $menuSets[$i]; } } // if we get to this point, then we can not find a menuSet with the // specified label. So we return an empty string. // return ""; }