AmesimKnowledge

Community Knowledge > Headless Automation (AMEOpen)

AMEOpen headless API on Amesim 2511: module, init, library loading and class map

Run status: EXERCISED 2026-09-03 on Simcenter Amesim 2511 (D:\Amesim\Simcenter_Amesim_2511\Amesim), through the amesim MCP server in the amesim-mcp repo. Nothing on this page is transcribed from documentation alone.

Simcenter Amesim ships two Python-facing APIs. ame_apy is the solver-facing circuit API: open, build, run, read results. It cannot search the libraries, read a submodel's port table before the submodel is placed, or say whether a proposed connection is legal. AMEOpen can, with no model open at all, and it also reads an existing model's structure, global parameters, post-processing definitions and saved result sets without a build or a run.

Where the module lives

  • File: scripting\python\win64\ameopen_headless_direct_py.pyd under the Amesim install root.
  • Import name: ameopen_headless_direct_py.
  • It loads only under Amesim's bundled Python 3.12. The pyd is version-locked in the same way ame_apy.pyd is; a system Python 3.13 never loads it. The amesim-mcp bridge (run_bridge.py) bootstraps the environment and DLL directories for that interpreter, and the AMEOpen tools ride on the same launcher.

Initialisation

The API is initialised once per process, lazily, in Modeling mode. One API instance per process: model files are then opened per call and closed again (read tools), or saved and closed (write tools). Keep that instance on a single thread, see Two engineering traps.

LibraryManager needs every library path

Freshly initialised, the API's LibraryManager knows 3 categories. That is not the installed library set, it is the default search path. Add every $AME/lib* directory to the library manager and the count becomes 40 or more categories: hydraulic, signal, mechanical, thermal, thermal-fluid, pneumatic, electric motors and drives, aero, and more. The amesim_lib_paths tool does this on first use and reports the paths and every category it found.

If a search for a common submodel (an orifice, a tank, a first-order lag) returns nothing, check the category count before suspecting the query.

Class map

The classes actually used on 2511, and what each answers:

Class Role
API The process-wide entry point. Owns the mode (Modeling), the library manager, and file open/close.
LibraryManager Library search paths and the category list. Search icons and submodels by substring.
Category One library category, for example hydr, sig, meca, th, tf, pn, emd, esc. Lists its icons.
ElementDefinition One icon: its ports with tags (HFlow, Signal, Thermal, RShaft...), the submodel variants that fit it, and the owning library.
Submodel One submodel, for example HYDORF0 or SIGRECEI0: public parameters with defaults, and its ports.
SubmodelPort One port of a submodel. Its variables carry an IO direction (Input or Output), a unit, a dimension, and for inputs an input type (InputBasic or InputWithDefaultValue). This is the data the connection validator runs on.
ModelFile A saved .ame file opened without a build: circuit, global parameters, run parameters, post-processing definitions, result sets.
Circuit The sketch inside a model file: its elements and connections.
Element One placed component: alias, icon, submodel, parameters, connected and unconnected ports.
SimulationRunner Runs a model from AMEOpen and returns a SimulationResult.
SimulationResult Final values and time series for variable paths. On 2511 only the runner's in-session result loads, see Three limitations.
ProcessingData The model's post-processing (expression) variables: list, add, remove.

The tool surface built on it

amesim_lib_paths, amesim_lib_search, amesim_lib_icon, amesim_lib_submodel, amesim_validate_connections, amesim_model_overview, amesim_unconnected_ports, amesim_result_sets, amesim_result_values, amesim_plot, amesim_global_parameters, amesim_post_processing. Every one was exercised on 2511 through the MCP server on 2026-09-03. The surface mirrors the Siemens "Simcenter AI Agents" Amesim bundle (amesim-agentic-toolkit 0.2.3), whose own modeling server targets 2604 and does not start on 2511, so this is a clean reimplementation on the API that ships inside 2511. See The Siemens Amesim doc server.

Do not cross the two APIs on one file

AMEOpen write tools (global parameters, post-processing) open, save and close the file per call. The ame_apy session does not see those edits and AMEOpen does not see the session's. Never point an AMEOpen write tool at the model the ame_apy session currently has open: the last save wins.

Source: amesim-mcp/README.md (AMEOpen tools) and amesim_open.py docstring, commits c287c02, 944cc7c, f2f57f4 · retrieved 2026-09-03