Skip to content
Andreas Nicolai edited this page Nov 29, 2018 · 22 revisions

FMICodeGenerator wiki

User Guide

The readme.md file (see main project page) holds an introduction to the tool and the usage.

API

To use the FMUCodeGenerator functionality 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()
Clone this wiki locally