-
Notifications
You must be signed in to change notification settings - Fork 26
Home
Andreas Nicolai edited this page Nov 29, 2018
·
22 revisions
The readme.md file (see main project page) holds an introduction to the tool and the usage.
To use the FMU code generated from other software, you can use the Python-API provided by the Python library. Basically, you create an instance of class FMIGenerator()
, specify its attributes and call the member function generate()
. As simple as that :-)
# import FMIGenerator class and data types
from FMIGenerator import *
# create instance of FMIGenerator class
fmiGen = FMIGenerator()
# specify attributes
fmiGen.modelName = "MyFirstFMU"
fmiGen.description = "My first auto-generated FMU. Awesome, right?"
fmiGen.targetPath = "../fmus" # relative path to current working directory or absolute file path
# now generate the FMU
fmiGen.generate()
# and print the messages collected along the way
fmiGen.printMessages()