SetModel - MapleSim Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


SetModel

set linked Modelica or MapleSim model

 

Calling Sequence

Parameters

Returns

Description

Examples

Calling Sequence

A := MapleSim:-LinkModel;

A:-SetModel(modelname)

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):

AMapleSim:-LinkModelmodelica=catkerneloptstoolboxdir=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

(1)

Setting linked model to the "Ball" model.

A:-SetModelBall

Check that setting was successful:

A:-GetModel

Ball

(2)

See Also

MapleSim

MapleSim[LinkModel]

MapleSim[LinkModel][GetModel]