SetModel
set linked Modelica or MapleSim model
Calling Sequence
Parameters
Returns
Description
Examples
A := MapleSim:-LinkModel;
A:-SetModel(modelname)
modelname
-
string ; name of the model in the linked Modelica file or the filename of the MapleSim model
none
A:-SetModel links A to the specified model.
If A is linked to a Modelica file, SetModel allows you to choose a different model defined in the same Modelica file.
If A is linked to a MapleSim model, SetModel expects the filename of a new model to link to.
It is recommended that you use the LinkModel command to change the linked model instead of the SetModel command.
The A := MapleSim:-LinkModel() statement needs to be run prior to successfully using any of the ModelObject A's export functions.
Linking to a Modelica model (located in .mo file):
A≔MapleSim:-LinkModel⁡modelica=cat⁡kernelopts⁡toolboxdir=MapleSim,/data/examples/BouncingBall.mo,Main:
There are two models in this Modelica file: "Main" and "Ball". Check which model A is linked to:
A:-GetModel⁡
Main
Setting linked model to the "Ball" model.
A:-SetModel⁡Ball
Check that setting was successful:
Ball
See Also
MapleSim
MapleSim[LinkModel]
MapleSim[LinkModel][GetModel]
Download Help Document