Tutorial
Compiling the code
API compiling the code
You can compile the code for your circuit with the AMEGenerateCode AMEGenerateCode
API
AMEGenerateCode
function.
Note
Compilation will fail if there are any unconnected ports in your circuit, or if a component or line does not have an assigned submodel.
The following compilation functions are also available:
AMEGetCompilers AMEGetCompilers
API AMEGetCompilers : listavailablecompilers.AMESetCompiler AMESetCompiler
API AMESetCompiler : setyourfavoritecompiler.AMESetDebugCompilation AMESetDebugCompilation
API AMESetDebugCompilation : switch between debug or release compilation modes.
Add the following line to your script in order to compile the circuit. You can add this line before the run parameter value settings:
Copy
# Generate code
AMEGenerateCode()
Warning
You are strongly advised to compile the code just before running the simulation, in order to be certain that the compiled version of your model used for simulation is up to date. See Running a simulation.
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Circuit_API/Compiling_the_code · retrieved 2026-07-17