Skip to content

Commit 0bfa400

Browse files
committed
[ModelicaSystemDoE] update set parameter expressions for str and bool
1 parent fc16f22 commit 0bfa400

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

OMPython/ModelicaSystem.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,10 +1798,10 @@ def prepare(self) -> int:
17981798

17991799
pk_value = pc_structure[idx_structure]
18001800
if isinstance(pk_value, str):
1801-
expression = f"setParameterValue({self._modelName}, {pk_structure}, $Code(=\"{pk_value}\"))"
1801+
expression = f"setParameterValue({self._modelName}, {pk_structure}, \"{pk_value}\")"
18021802
elif isinstance(pk_value, bool):
18031803
pk_value_bool_str = "true" if pk_value else "false"
1804-
expression = f"setParameterValue({self._modelName}, {pk_structure}, $Code(={pk_value_bool_str}));"
1804+
expression = f"setParameterValue({self._modelName}, {pk_structure}, {pk_value_bool_str});"
18051805
else:
18061806
expression = f"setParameterValue({self._modelName}, {pk_structure}, {pk_value})"
18071807
res = mod_structure.sendExpression(expression)

0 commit comments

Comments
 (0)