Creating an Action

You can create an action that lets you perform interactively what the Enterprise Knowledge Language (EKL) enables you to do. For example, you can perform search and query operations.

Notes:
  • Actions can be upgraded. Like with other objects using computation algorithms, the upgrade command switches all algorithms used in expressions to the last available version of algorithms. When the relation is modified explicitly, it is automatically upgraded.
  • When creating an action with no arguments, you can choose not to display the action dialog box when executing it. To do so, right-click the action in the tree and select No dialog box when running an action without arguments.
  • You can associate a picture with the action.


Before you begin: You must have created geometry.
See Also
Associating an Image with an Action
  1. From the Compass, click 3D Modeling Apps , and select Engineering Rules Capture.
  2. To create an action, do the following:
    1. Click Action .
    2. In the Action Editor, enter the arguments in the Argument list frame.
    3. Enter the action script.
    4. Click OK.
    Important:
    • Argument types must be written in English.
    • The editor supports the autocompletion that allows you to access available variables, Knowledge types, or methods.
    Tips:
    • You can use the following keyboard shortcuts in the editor:
      • Ctrl+Z: Undo. Lets you delete the last word you entered.
      • Ctrl+Y: Redo.
      • Ctrl+F: Search in text.
      • Ctrl+A: Select all.
    • You can reorder the arguments in the list using the up or down arrows.

Example

In this example, you are going to create an action that computes the volume of pads under a body.

  1. Create two pads in a body.
  2. From the Compass, click 3D Modeling Apps , and select Engineering Rules Capture.
  3. Click Action to create an action that searches for the pads contained in the selected body and computes the volume of these pads. The Action editor opens. Enter the following script and click OK:
    Inputs box
    B: BodyFeature
    Editor

    let V(Volume)
    B.Query("Pad","").Compute("+","Solid", "smartVolume(x)",V)
    Message("Total volume of the pads under this body : #",V)

  4. Right-click the action in the tree and select Action.1 object > Run.

    Notes: The Process literal arguments as parameters option lets you disregard literal arguments as inputs when running an action. Instead of selecting a parameter in the tree, you can directly enter a value for each literal argument without creating a parameter in the first place.

    The Process object arguments as optional option lets you consider object input arguments as optional while running an action. When this option is on, all the object inputs are considered as Not Valuated by default and the NULL parameter value passes to the EKL Action script. You can optionally select objects while running this action. By default, this option is specified as off.

  5. Click Body.2 in the tree and click OK.

    The volume of the pad is computed.