mdlIObject AddAttachment

Adds an attachment to definition type entities (System, Analysis, Template, or Assembly).

Syntax

mdlIObject_handle AddAttachmentnew_handle, varname, label, attachment_type, attachment_tag

Application

MotionView Tcl Modify

Description

This command adds an attachment using the ‘varname’, ‘label’, and ‘attachment_type’ arguments. The 'label' and ‘varname’ are required attributes to create any entity (Point, Body, Marker, Joint, etc.). In case of an Attachment, you must also specify the type of entity (for example Point, Body ,or Vector) which will be used to attach to the other System.

Inputs

new_handle
The handle of the newly created attachment.
varname
The variable name of the attachment.
label
The label of the attachment.
attachment_type
The type of entity that can attach to the System/Assembly/Analysis.
attachment_tag
The tag for the attachment (the ’attachment_tag’ is basically a keyword which will be looked for in valid scope for an attachment candidate).

Example

To add an attachment to a definition type entity:
hwi GetSessionHandle mySessionName 
mySessionName GetProjectHandle myProjectName 
set activePageNum [myProjectName GetActivePage]
myProjectName GetPageHandle myPageName $activePageNum
set activeWinNum [myPageName GetActiveWindow]
myPageName GetWindowHandle myWindowName $activeWinNum
myWindowName GetClientHandle myClientName 
myClientName GetModelHandle myModelName 
myModelName GetObjectHandle obj_handle
obj_handle AddAssembly assem_handle assem_0 "\"Assembly 0\""  <data file>
assem_handle AddAttachment attach_handle att_0 "\"Attachment 0\"" Point Tag_0; 
assem_handle ReleaseHandle
attach_handle ReleaseHandle;
obj_handle ReleaseHandle;
myModelName ReleaseHandle
myClientName ReleaseHandle
myWindowName ReleaseHandle
myPageName ReleaseHandle
myProjectName ReleaseHandle
mySessionName ReleaseHandle

Errors

Returns the handle of the newly created attachment if successful. If there is an error, an error code will be returned.