Message Boards Message Boards

0
|
7713 Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

[?] Use WSMSetValues for setting records and replaceable packages?

My model has a parameter field that expects a record, but when I try to use WSMLink to set it e.g.

WSMSetValues[model,{"component.recordParam" -> DotName["myPackage","myRecord()"]

I get the error

WSMSetValues::irl: The list of rules is not on the form {"variable" -> numericValue, ...}.

If I don't use DotName and pass it as a string, it shows up as a string in the model, which will fail to compile/verify.

In addition to setting this record parameter, I will also want to be able to set the Medium of a model using WSMSetValues. Is there a generic way of setting a parameter that handles any type via WSMLink? Thanks.

POSTED BY: Eric Smith
3 Replies
POSTED BY: Malte Lenz

Glad it helped.

As usual, the functions in the WSMLink`Library` context are undocumented and therefore unsupported, so they might stop working in future releases.

POSTED BY: Malte Lenz

Awesome, I figured I'd have to do some text editing, but I didn't know about WSMLink'Library'EvaluateModelicaInput. Just now I was just able to script about 30 records and use within to put them where I needed them. Thanks!

POSTED BY: Eric Smith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract