DeleteAttachment - MapleSim Help

DeleteAttachment

delete an attachment from the linked MapleSim model

Parameters

 name - string ; the name of the attachment to delete

Description

 • A:-DeleteAttachment(name) deletes the attachment name from the linked MapleSim model A.
 • A:-DeleteAttachment cannot be used on models linked to Modelica files.
 • 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≔\mathrm{MapleSim}:-\mathrm{LinkModel}\left('\mathrm{filename}'=\mathrm{cat}\left(\mathrm{kernelopts}\left('\mathrm{toolboxdir}'=\mathrm{MapleSim}\right),"/data/examples/RLCcircuit.msim"\right)\right):$

Set an attachment to the linked MapleSim Model:

 > $\mathrm{data}≔"this will be the ship"$
 ${\mathrm{data}}{≔}{"this will be the ship"}$ (1)
 > $A:-\mathrm{SetAttachment}\left("data.txt",\mathrm{data},'\mathrm{category}'="other"\right)$

Check the attachment was set:

 > $A:-\mathrm{ListAttachments}\left(\right)$
 $\left[{"data.txt"}\right]$ (2)

Delete the attachment

 > $A:-\mathrm{DeleteAttachment}\left("data.txt"\right)$

Check that the deletion was successful:

 > $A:-\mathrm{ListAttachments}\left(\right)$
 $\left[\right]$ (3)