mdlIObject ReplaceAssembly

Replaces an existing assembly in the model with another assembly from the Suspension Library.

Syntax

mdlIObject_handle ReplaceAssembly hNew, hOld, data_file, label, attach_args

Application

MotionView Tcl Modify

Description

This command replaces an existing assembly in the model with another assembly from the Suspension Library.

Inputs

hNew
The name of the handle to the new assembly.
hOld
The handle of the assembly that is being replaced.
data_file
The name of the data file that should be used to create the new assembly.
label
The label to be used for the new assembly. If the label is blank, it will be extracted from the data or definition file.
attach_args (Optional)
Optional attachment arguments.

Example

To replace an existing assembly with a new one:
hwi OpenStack
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 GetChildHandle myAssembly assem_0
myModelName ReplaceAssembly myNewAssembly myAssembly "NewFrontAssembly_data.mdl" 
"New Front Assembly"
myAssembly ReleaseHandle;
myModelName ReleaseHandle
myClientName ReleaseHandle
myWindowName ReleaseHandle
myPageName ReleaseHandle
myProjectName ReleaseHandle
mySessionName ReleaseHandle
hwi CloseStack

Errors

Returns 0 if successful, otherwise an error code.