Use OpenOrImportSimulation
- Last UpdatedSep 11, 2025
- 1 minute read
You can find the OpenOrImportSimulation utility function in the lib folder of the AVEVA Real-Time System (RTS) installation.
To use it, at the top of your sequence cycle script, add the following line:
#load "ImportUtility.csx"
You can then use the OpenOrImportSimulation() function in your sequence cycle script to access a simulation. This function opens a simulation if it exists in the Simulation Repository. If the simulation doesn't exist, the function imports the given .simx file. The function returns true if it successfully opens or imports the simulation. It also re-imports the .simx file if the file has changed from when you last imported the simulation.
See the cycle script for the simsample example sequence.
The OpenOrImportSimulation utility function is a wrapper for the internally defined OpenImportSimulation method of the global Activity object. Unlike the OpenOrImportSimulation utility function, the Activity.OpenImportSimulation method doesn't reimport the .simx file when a newer version is detected. For this reason, it's better to use the OpenOrImportSimulation utility function instead.
Use the ImportIfLibraryChanged function to import a library (.libx), where the input argument is the library name that you want to import from the lib folder. The function imports the library if it is not present in the AVEVA Process Simulation repository. Additionally, when you update the library in the lib folder to a new version, the function automatically deletes the old version of the library from the repository and then imports the latest version.