Dymola Interface
The Dymola interface is used to interface Python and Dymola in 3DEXPERIENCE.
This API is globally compatible with Dymola and allows scripting a Dymola Behavior Modeling or stand-alone Dymola session.
Important: The Dymola Interface can only be used with an already running Dymola Behavior Modeling session. For starting a new Dymola Behavior Modeling session or multiprocessing, use the Virtual Execution Interface. |
The main Python object in dymola.egg is the DymolaInterface. It can be invoked by the following API:
dymola = DymolaInterface(startDymola=False,
port=44000)
The essential parameters for the API, among others, are startDymola and port. Following is the complete definition of DymolaInterface:
def __init__(self, dymolapath="", use64bit=True, port=-1,
showwindow=False, debug=False, allowremote=False, nolibraryscripts=False,
startDymola=True):
Parameters | Type | Description |
---|---|---|
dymolapath
|
String | This parameter represents the path to Dymola.exe. The default value, an empty string, indicates that the path is detected automatically. |
use64bit
|
Boolean | This parameter represents the version of Dymola. The default value,
True , indicates that the 64-bit version of
Dymola is used. The value False indicates a 32-bit
version. |
port
|
Integer | This parameter represents the port number
used for connecting to Dymola. The default value is
-1 , which indicates that the port is assigned
automatically.
|
showwindow
|
Boolean | This parameter controls the visibility of the Dymola window when calling
functions in the interface. The default value,
False , indicates that the Dymola window is
visible and runs in the background. |
debug
|
Boolean | This parameter is used for debugging the Dymola Python interface. The
default value is False . Setting the value to
True sends the debug messages to the console. |
allowremote
|
Boolean | This parameter when set to True , enables access from
another machine. The default value is False , which
indicates local connection. |
nolibraryscripts
|
Boolean | This flag corresponds to the command-line
argument with the same name. The default value is
False .
|
startDymola
|
Boolean | This parameter enables starting of Dymola
automatically. The default value is
True .
|
For more information, see Dymola Interface Commands.