SetModel

Parameters

 modelname - string ; name of the model in the linked Modelica file or the filename of the MapleSim model

Returns

 • none

Description

 • 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.

Examples

Linking to a Modelica model (located in .mo file):

 > $A≔\mathrm{MapleSim}:-\mathrm{LinkModel}\left('\mathrm{modelica}'=\left[\mathrm{cat}\left(\mathrm{kernelopts}\left('\mathrm{toolboxdir}'=\mathrm{MapleSim}\right),"/data/examples/BouncingBall.mo"\right),"Main"\right]\right):$

There are two models in this Modelica file: "Main" and "Ball". Check which model A is linked to:

 > $A:-\mathrm{GetModel}\left(\right)$
 ${"Main"}$ (1)

Setting linked model to the "Ball" model.

 > $A:-\mathrm{SetModel}\left("Ball"\right)$

Check that setting was successful:

 > $A:-\mathrm{GetModel}\left(\right)$
 ${"Ball"}$ (2)