Main Toolbar

The following methods are associated with 3ds max's main toolbar:

enableUndo <boolean>

Enables or disables the Undo icon.

hitByNameDlg()

Opens the standard 3ds max Select By Name dialog allowing users to select objects. Returns false if the user cancels out of the Select by Name dialog, true otherwise.

toolMode.uniformScale()

Set scale mode to Uniform Scale.

toolMode.nonUniformScale()

Set scale mode to Non-uniform Scale.

toolMode.squashScale()

Set scale mode to Squash.

enableRefCoordSys <boolean>

Enables or disables the Reference Coordinate System drop-down list.

toolMode.coordsys <mode_name>

Sets the Reference Coordinate System. Valid <mode_name> values are:

#view

#screen

#world

#parent

#local

#grid

getRefCoordSys()

setRefCoordSys <mode_name>

Get and set the Reference Coordinate System. Valid <mode_name> values are:

#hybrid -- View

#screen -- Screen

#world -- World

#parent -- Parent

#local -- Local

#object -- Pick object or Grid û not valid for setRefCoordSys()

enableCoordCenter <boolean>

Enables or disables the Coordinate System Center icon.

getCoordCenter()

setCoordCenter <name>

Get and set the Coordinate System Center. Valid <name> values are:

#local -- Use Pivot Point Center

#selection -- Use Selection Center

#system -- Use Transform Coordinate Center

toolMode.transformCenter()

Sets Coordinate System Center to Transform Coordinate System.

toolMode.selectionCenter()

Sets Coordinate System Center to Selection Center.

toolMode.pivotCenter()

Sets Coordinate System Center to Pivot Point Center.

getNumAxis()

This method reflects the Coordinate System Center state. If it is set to Pivot Point Center then this method returns #individual otherwise #all.

setToolBtnState <name> <boolean>

Set the specified tool buttons on or off. This method does not put into the mode, it just changes the state of the tool button. This method does not change the state of any button other than the specified button. The valid <name> values are:

#move -- Move button on/off

#rotate -- Rotate button on/off

#nuscale -- Scale button on/off û doesn't change scale type

#uscale -- Scale button on/off û doesn't change scale type

#squash -- Scale button on/off û doesn't change scale type

#select -- Select button on/off

getToolbtnState <name>

Returns whether the specified tool button is on or off as a <boolean> value. Valid name values are:

#select

#move

#rotate

#uscale -- returns true if any of the scale button states is on

#nuscale -- returns true if any of the scale button states is on

#squash -- returns true if any of the scale button states is on

The following methods deal with the Named Selection Set drop-down list. These methods are not intended for casual usage.

clearCurSelSet()

Clears the edit field of the Named Selection Set drop-down list. Does not deselect the currently selected objects.

clearSubSelSets()

Clears the named selections from the Named Selection Set drop-down list. The named selection sets still exist, they just don't show in the drop-down list. This command can be dangerous to use unless you are in Sub-Object mode in the Modify panel, as there is not a direct method to rebuild the Named Selection Set list. When in Sub-Object mode in the Modify panel, the namedSelSetListChanged() method will rebuild the list.

namedSelSetListChanged()

When in Sub-Object mode in the Modify panel, this method will rebuild the named selection set list.

setCurNamedSelSet <string>

Sets the edit field of the Named Selection Set drop-down list to the specified string. This method not change the current selection set or add the specified string to the named selection set list.

appendSubSelSet <string>

Appends the specified string to the Named Selection Set drop-down list. This method not change the current selection set. Modifiers in 3ds max use this method to add sub-object named selection sets to the Named Selection Set drop-down list. This is done whenever the selection level changes.

The following 3ds max system global variables are associated with the main toolbar:

preferences.constantReferenceSystem

Lets you get and set whether to use a constant Reference System for the Move, Rotate, and Scale tools. A Boolean value - true if Constant is on, false if off. This variable matches the Constant check box in Customize menu > Preferences > General > Reference Coordinate System.

toolmode.commandmode

Get/set the 3ds max command mode. The return value when getting the command mode is a <name> value if the command mode is a recognized command mode, otherwise the return value is an integer value. The recognized command modes are:

#SELECT

#MOVE

#ROTATE

#NUSCALE

#USCALE

#SQUASH

#VIEWPORT

#HIERARCHY

#CREATE

#MODIFY

#MOTION

#ANIMATION

#CAMERA

#NULL

#DISPLAY

#SPOTLIGHT

#PICK

When setting the 3ds max command mode, only the following command modes are valid:

#SELECT

#MOVE

#ROTATE

#NUSCALE

#USCALE

#SQUASH

toolmode.axisConstraints

Get/set the 3ds max axis constraints. The axis constraints values are:

#X

#Y

#Z

#XY

#YZ

#ZX