Your Ad Here

Go to: Synopsis. Flags. Return value. MEL examples.

Synopsis

dimWhen [-clear] [-false] [-true] <condition-name> <UI-object-name>

dimWhen is undoable, queryable, and editable.

This method attaches the named UI object to the named condition so that the object will be dimmed when the condition is in a particular state.

This command will fail if the object does not exist. If the condition does not exist (yet), that's okay --- a placeholder will be used until such a condition comes into existence.

The UI object should be one of two things, either a control or a menu item.

Flags

clear, false, true
Long name (short name) [argument types] Properties
-false(-f) create
Dim the object when the condition is false.
-true(-t) create
Dim the object when the condition is true. (default)
-clear(-c) create
Remove the condition on the specified dimmable.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command

Return value


None

MEL examples

//    Create a window with a menu item and button that will dim if
//    there are no objects selected in the scene.
//
string $window = `window -menuBar true -title "dimWhen Example"`;
menu -label "Edit";
string $menuItem = `menuItem -label "Delete Selection" -command ("delete")`;
columnLayout -adjustableColumn true;
string $button = `button -label "Delete Selection" -command ("delete")`;

//    Create a few buttons to create some objects, select all the objects in
//    the scene, and clear the selection.
//
button -label "Create Objects" -command ("sphere; cone; cylinder;");
button -label "Select All" -command ("select -all");
button -label "Select Nothing" -command ("select -clear");

//    Add the dim conditions.
//
dimWhen -false SomethingSelected $button;
dimWhen -false SomethingSelected $menuItem;

showWindow $window;

  

Return to Autodesk Index


Your Ad Here