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

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : MapleSim : MapleSim Application Programming Interface : API Commands : MapleSim/LinkModel/SetAttachment

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

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

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

A:=MapleSim:-LinkModel'filename'=catkernelopts'toolboxdir'=MapleSim,/data/examples/RLCcircuit.msim:

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

data:=this will be the ship

data:=this will be the ship

(1)

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

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

L:=1,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:

fd:=FileTools:-Text:-Opensamplefile.txt,create=true,overwrite=true:

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

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]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam