< Previous | Contents | Manuals Home | Boris FX | Next >

Actions

Actions are a short-hand way to locate and control right-click menu items in viewports, buttons on the control panels, and on the main menu. The action is identified by a name string and the underlying id number can be determined as well. You can see the actions on the Edit/Keyboard Manager list, with different actions for the different contexts.

The numeric identifier shows the type of action: numbers under 30000 are button-type actions that need to be "clicked", numbers from 30000 to 40000 are pseudo-menu actions that can be performed at any time, from 40000 to 50000 are main and right-click menu actions, and over

50000 there are dynamically-generated menu IDs (not accessible as actions) corresponding to the most-recently-used files, active objects, scripts, safe areas, phase types, etc.

Actions are the only way to access right-click menus in viewports (Camera View, Perspective View, etc). For example,

camvu = hlev.Main().ByClass("CamVu") camvu.PerformActionByNameAndWait("Cam/Lock Selection")

will turn on the Lock Selection item on the camera view's right-click menu. (You may need more complex code to identify the desired viewport window.)

There are also action names for buttons on the various control panels, ie Summary/AUTO. Do not use the Perform* routines for buttons, use something like:

idno = hlev.ActionID("Summary/AUTO") # idno will be < 40000 hlev.Main().ByID(idno).ClickAndContinue()

Actions that have no qualifier—no name followed by a slash(/) at the beginning—can generally be sent to the main window at any time, even if the corresponding user-interface element is not presently visible.

Note : there are some generic at-all-times actions from the keyboard manager that have id numbers under 30000 but that should be treated as if they were main menu operations. These special actions can be identified with the context "Any/...", ie you can start a solve at any time with

hlev.PerformActionByNameAndContinue("Any/Go!")

Action names are automatically generated from the menu information etc, and as such, may change from time to time to improve clarity. The numeric identifiers are unlikely to change. The action names are somewhat more robust than searching the menus or button names directly, because those names might change due to localization.

Actions() Returns an iterator over the entire set of action names (over 600). Use to print out or search them all.

ActionID(nm) Returns the numeric identifier for the action—this is not its index into Actions(). If the number is under 40000, it is a button, over 40000, it is a menu-type operation.

PerformActionByNameAndWait(nm) Send the action to the main window to simulate

menu operations. Use .ByID().Click...() for button actions.

PerformActionByNameAndContinue(nm) Send the action to the main window, ie to the

viewports to simulate menu operations. Use

.ByID().Click...() for button actions.

PerformActionByIDAndWait(idno) Send the action to the main window to simulate

menu operations. Use .ByID().Click...() for button actions.

PerformActionByIDAndContinue(idno) Send the action to the main to simulate menu

operations. Use .ByID().Click...() for button actions.


©2023 Boris FX, Inc. — UNOFFICIAL — Converted from original PDF.