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

Online Help

All Products    Maple    MapleSim


SetAttachment

set the attachment (text, Maple structures, files) to the linked MapleSim model

 

Calling Sequence

Parameters

Returns

Options

Description

Examples

Calling Sequence

A := MapleSim:-LinkModel();

A:-SetAttachment(name, content, options)

Parameters

name

-

string ; name of the attachment

content

-

anything ; content of the attachment

options

-

(optional) equation(s) of the form name = value

Returns

• 

none

Options

• 

category : one of the following: "custom", "datasets", "cad", "other", "documents"

  

Specifies the category where the attachment should be placed. Default is "documents".

• 

filecopy : true or false

  

If set to true, the content parameter is assumed to be a name of the file to be attached to the active model. Default is false.

Description

• 

A:-SetAttachment sets the attachment to a linked model A.

• 

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 MapleSim model (located in .msim file):

AMapleSim:-LinkModelfilename=catkerneloptstoolboxdir=MapleSim,/data/examples/RLCcircuit.msim:

Setting the attachment (text) to the linked MapleSim Model:

datathis will be the ship

datathis will be the ship

(1)

A:-SetAttachmentdata.txt,data,category=other

Setting the attachment (a list) to the linked MapleSim Model:

L1,2,3,4:

A:-SetAttachmentdata.csv,L,category=datasets

Getting the data from the attachment:

A:-GetAttachmentdata.csv

1.2.3.4.

(2)

Listing the attachments of the linked MapleSim Model:

A:-ListAttachments

data.txt,data.csv

(3)

A:-ListAttachmentsshowcategories=true

data.txt,other,data.csv,datasets

(4)

Setting the attachment (a file) to the linked MapleSim Model:

fdFileTools:-Text:-Opensamplefile.txt,create=true,overwrite=true:

FileTools:-Text:-WriteStringfd,This is a test file.\n:

FileTools:-Text:-Closefd:

A:-SetAttachmentsampleAttachedFile.txt,catcurrentdir,/samplefile.txt,filecopy=true:

Listing the attachments of the linked MapleSim Model:

A:-ListAttachments

data.txt,data.csv,sampleAttachedFile.txt

(5)

See Also

MapleSim

MapleSim[LinkModel]

MapleSim[LinkModel][ListAttachments]