lira_run_script
Run custom Python code inside LIRA-SAPR to cover tasks the dedicated tools do not handle, with direct access to the COM API, model adapter, and constants.
Instructions
Run Python code inside the server with full access to LIRA, for anything the other tools do not cover. Prefer the dedicated tools when one fits.
Names available: lira (LIRA's Application COM object), doc (the document of
model, default the active one; None if none is open), adapter (the server's
LIRA adapter: read_table(ref, name), write_table(ref, name, rows), units(),
node_displacements(path, nodes, cases), element_forces(...), ...), constants
(LIRA's enum constants, e.g. constants.kLiraTable_Nodes_Coordinates). Assign
result to return a JSON value; print() output is returned as "output".
The model file is backed up first. Python code stops after timeout_s; a COM call
that hangs (e.g. LIRA shows a dialog) is not interrupted. LIRA's API description:
LIRA-FEM COM type library "LiraSapr" (see lira_status capabilities).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| model | No | ||
| timeout_s | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||