Execute Python code
execute_codeRun sandboxed Python against the ETABS COM API to query, analyze, design, or extract reports from a live model using a pre-connected SapModel object.
Instructions
Execute Python code in a sandbox against the ETABS COM API (call discover_api and read_skills first).
The sandbox provides a pre-connected model variable (SapModel) and optional input_data
(if input_data_path is provided), plus json and math modules.
import statements, dir(), getattr(), and dunder access are BLOCKED.
The last expression value or an explicit result = ... assignment is returned.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python source code to execute. Use ``model`` (SapModel) to interact with ETABS. | |
| instance | No | Alias from ``list_instances`` (e.g. ``etabs1``). Omit when only one instance runs. | |
| overwrite | No | Allow overwriting an existing output file. | |
| input_data_path | No | Path to a ``.csv`` or ``.xlsx`` file. Content is injected as immutable ``input_data``. | |
| output_data_path | No | Path to write the ``result`` value as ``.csv`` or ``.xlsx``. ``result`` must be a list-of-lists (flat) or dict of sheet dicts (multi-sheet). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||