@@ -117,7 +117,8 @@ def __init__(
117
117
variableFilter : Optional [str ] = None ,
118
118
customBuildDirectory : Optional [str | os .PathLike ] = None ,
119
119
omhome : Optional [str ] = None ,
120
- session : Optional [OMCSessionBase ] = None
120
+ session : Optional [OMCSessionBase ] = None ,
121
+ build : Optional [bool ] = True
121
122
):
122
123
"""Initialize, load and build a model.
123
124
@@ -146,6 +147,9 @@ def __init__(
146
147
session.
147
148
session: OMC session to be used. If unspecified, a new session
148
149
will be created.
150
+ build: Boolean controlling whether or not the model should be
151
+ built when constructor is called. If False, the constructor
152
+ simply loads the model without compiling.
149
153
150
154
Examples:
151
155
mod = ModelicaSystem("ModelicaModel.mo", "modelName")
@@ -217,7 +221,8 @@ def __init__(
217
221
elif fileName is None and modelName is not None :
218
222
self .loadLibrary (lmodel = self .lmodel )
219
223
220
- self .buildModel (variableFilter )
224
+ if build :
225
+ self .buildModel (variableFilter )
221
226
222
227
def setCommandLineOptions (self , commandLineOptions : str ):
223
228
# set commandLineOptions if provided by users
0 commit comments