Scripting and Customization

Overview

Adams Modeler provides a mechanism to record and playback Python commands that are executed in session.

Record a Macro

To record a macro in Adams Modeler, select the Record Macro button at the top of the application. A dialog will appear that will allow you to specify a path, optionally give it a name that will be displayed in the Recent Macros menu. You may also choose to specify a keyboard shortcut to associate with the macro. Once associated, pressing the hotkey will automatically execute the python script. Control is available to pause recording and this will omit commands executed while paused.  You select the Stop Recording button to conclude recording of commands.

Play a Macro

The Play Macro button will sequentially execute commands in the macro file. The Python syntax that is currently supported at Adams Modeler is a mixture of existing Adamspy commands from Adams View and new Apex compliant Adams Modeler Python.

New Python syntax is necessary for macro recording to support Undo/Redo and to run the application from an external console such as iPython, PyCharm, Eclipse, etc. that have built in utilities for debugging, inserting break points, and built in Intellisense for valid syntax auto-completion.

Current Limitations

  • Incomplete Scripting Coverage: Not all Adams Modeler commands have scripting syntax support. Features without scripting/macro record capability include: Scenario creation and MNF export
  • Adamspy Support: All existing Adamspy commands should execute in Adams Modeler. For example, currently General Forces are not supported in Adams Modeler. A Python file that contains valid Adamspy syntax to create a General Force will create the force in Adams Modeler.  The Model Browser and Graphics will not display the General Force as a Read-only object in Adams Modeler. Executing an adm export command, exporting the model as cmd, or context switching to the Adams View interface will show the inclusion of the General Force.
  • No Generative Support for Scripted Objects: If a Joint, Bushing, or SpringDamper is created via playing a macro file where the connector is created by selecting a geometry face, the connector stays at its original location if the user executes a Pull/Push on that geometry face. The generative association between the geometry face and the connector is lost.