mdlIObject AddNewAssembly
Adds a new assembly from an existing or new data and definition file.
Syntax
mdlIObject_handle AddNewAssembly new_handle, varname, label, data_file_path, def_file_path, create_new_def_file, def_name def_type
Application
MotionView Tcl Modify
Description
This command adds a new assembly using the ‘varname’ and ‘label’ from existing or new data and definition file. The ‘def_type’ will be the assembly definition type and ‘def_name’ will be the definition name.
Inputs
- new_handle
- The handle of the newly created assembly.
- varname
- The variable name for the assembly.
- label
- The label for the assembly.
- data_file_path
- The path for the new data file.
- def_file_path
- The path for the new/existing definition file.
- create_new_def_file
- This is boolean variable that can take true or false. If true is passed, ‘def_file_path’ will be created (replaced if already exist). In case of false the ‘def_file_path’ should be already present.
- def _name
- The name of the assembly definition.
- def _type
- The type of assembly definition.
Example
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 AddNewAssembly assem_handle assem_0 "\"Assembly 0\"" C:/temp/data_file.mdl C:/temp/def_file.mdl true assem_def_name assem_type;
obj_handle ReleaseHandle;
assem_handle ReleaseHandle;
myModelName ReleaseHandle
myClientName ReleaseHandle
myWindowName ReleaseHandle
myPageName ReleaseHandle
myProjectName ReleaseHandle
mySessionName ReleaseHandle
Errors
Returns 0 if successful, otherwise an error code.