The Simcenter Amesim Export module in detail > Direct interfaces > Simcenter Amesim and the Visual Basic applications interface
Subroutines available in amesim.xlt
Warning
All the subroutines called AMEVba* are deprecated. Consider using the other subroutine from the Simulation Scripting API instead.
The AMEVbaGetPar subroutine
Definition
It reads parameter titles, parameter values and variable titles from an Simcenter Amesim system and stores them into three tables.
To use this subroutine, it is necessary that study parameters and variables have already been exported using the Export setup functionality of Simcenter Amesim.
Syntax
Call AMEVbaGetPar(system, inTitles, inValues, outTitles, subErr), or
AMEVbaGetPar system, inTitles, inValues, outTitles, subErr
Arguments
system: String expression whose value is the complete path and name of an Simcenter Amesim system without extension. If the system argument is an incorrect system name or path, an error message is displayed.
inTitles: Array of type String. It stores parameter titles imported from the Simcenter Amesim system specified by the system argument. It has to be declared in the main VBA code before calling AMEVbaGetPar.
inValues: Array of type Double. It stores parameter values imported from the Simcenter Amesim system specified by the system argument. It has to be declared in the main VBA code before calling AMEVbaGetPar.
outTitles: Array of type String. It stores variable titles imported from the Simcenter Amesim system specified by the system argument. It has to be declared in the main VBA code before calling AMEVbaGetPar.
subErr (optional, 0 by default): Integer. It stores a flag corresponding to the final status of the call to AMEVbaGetPar. If subErr = 0, AMEVbaGetPar has succeeded. If subErr = 1, AMEVbaGetPar has failed.
The AMEVbaPutPar subroutine
Definition
- It reads parameter titles and values in two corresponding tables, and writes them into the Simcenter Amesim system.
Syntax
Call AMEVbaPutPar(system, inTitles, inValues, subErr), or
AMEVbaPutPar system, inTitles, inValues, subErr
Arguments
system: String expression whose value is the complete path and name of an Simcenter Amesim system without extension. If the system argument is an incorrect system name or path, an error message is displayed.
inTitles: Array of type String. It writes parameter titles into the Simcenter Amesim system specified by the system argument. It has to be declared in the main VBA code before calling AMEVbaPutPar.
inValues: Array of type Double. It writes parameter values into the Simcenter Amesim system specified by the system argument. It has to be declared in the main VBA code before calling AMEVbaPutPar.
subErr (optional, 0 by default): Integer. It stores a flag corresponding to the final status of the call to AMEVbaPutPar. If subErr = 0, AMEVbaPutPar has succeeded. If subErr = 1, AMEVbaPutPar has failed.
The AMEVbaRun subroutine
Definition
- It reads parameters stored in the Simcenter Amesim system, it runs the simulation, and it generates simulation results.
Syntax
Call AMEVbaRun (system, subErr), or
AMEVbaRun system, subErr
Arguments
system: String expression whose value is the complete path and name of an Simcenter Amesim system without extension. If the system argument is an incorrect system name or path, an error message is displayed.
subErr (optional, 0 by default): Integer. It stores a flag corresponding to the final status of the call to AMEVbaRun. If subErr = 0, AMEVbaRun has succeeded. If subErr = 1, AMEVbaRun has failed.
The AMEVbaGetFinalRes subroutine
Definition
- It reads titles and values of final results in the Simcenter Amesim system and stores them into final result tables.
Syntax
Call AMEVbaGetFinalRes(system, outTitles, outValues, subErr), or
AMEVbaGetFinalRes system, outTitles,outValues, subErr
Arguments
system: String expression whose value is the complete path and name of an Simcenter Amesim system without extension. If the system argument is an incorrect system name or path, an error message is displayed.
outTitles: Array of type String. It stores final result titles imported from the Simcenter Amesim system specified by the system argument. It has to be declared in the main VBA code before calling AMEVbaGetFinalRes.
outValues: Array of type Double. It stores final result values imported from the Simcenter Amesim system specified by the system argument. It has to be declared in the main VBA code before calling AMEVbaGetFinalRes.
subErr (optional, 0 by default): Integer. It stores a flag corresponding to the final status of the call to AMEVbaGetFinalRes. If subErr = 0, AMEVbaGetFinalRes has succeeded. If subErr = 1, AMEVbaGetFinalRes has failed.
TheAMEVbaGetRes subroutine
Definition
- It reads titles and results in the Simcenter Amesim system and stores them into result tables.
Syntax
Call AMEVbaGetRes(system, outTitles, outValues, subErr), or
AMEVbaGetRes system, outTitles, outValues, subErr
Arguments
system: String expression whose value is the complete path and name of an Simcenter Amesim system without extension. If the system argument is an incorrect system name or path, an error message is displayed.
outTitles: Array of type String. It stores result titles imported from the Simcenter Amesim system specified by the system argument. It has to be declared in the main VBA code before calling AMEVbaGetRes.
outValues: Array of type Double. It stores result values imported from the Simcenter Amesim system specified by the system argument. It has to be declared in the main VBA code before calling AMEVbaGetRes.
subErr (optional, 0 by default): Integer. It stores a flag corresponding to the final status of the call to AMEVbaGetRes. If subErr = 0, AMEVbaGetRes has succeeded. If subErr = 1, AMEVbaGetRes has failed.
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Export/Subroutines_available_in_amesimxlt · retrieved 2026-07-17