mdlIObject AddAssembly
Adds an assembly using an existing data file.
Syntax
mdlIObject_handle AddAssembly new_handle, varname, label, data_file_path
Application
MotionView Tcl Modify
Description
This command adds a new assembly to a Model or Assembly using an existing data file. An assembly cannot be added under any type other than Model or Assembly.
Inputs
- new_handle
- The handle of the newly created assembly.
- varname
- The variable name of the assembly which will be created.
- label
- The label for the assembly.
- data_file_path
- The full path of the data file that will be used to create the assembly.
Example
To add an assembly using an existing data
file:
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_path>
assem_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 assembly if successful. If there is an error, an error code will be returned.