mdlIObject GetChildHandleByIdx
Obtains the handle of the child object using its index value.
Syntax
mdlIObject_handle GetChildHandleByIdx child_handle, index
Application
MotionView Tcl Query
Description
This command obtains the handle of the child object using its index value. This handle can further be used to edit the properties of the entity.
Inputs
- child_handle
- The handle name of the child.
- index
- The index number of the child whose handle is desired.
Example
To get the handle of a mass of a body using an index number and then change its
value:
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 BeginFlatListFastGet Body
myModelName GetChildHandleByIdx body_handle 2
body_handle GetChildHandle mass_handle mass
set body_mass [mass_handle GetEvaluatedValue]
set new_mass [expr $body_mass + 10];
mass_handle SetRawExpression $new_mass
mass_handle Evaluate
mass_handle ReleaseHandle
body_handle ReleaseHandle
myModelName ReleaseHandle
myClientName ReleaseHandle
myWindowName ReleaseHandle
myPageName ReleaseHandle
myProjectName ReleaseHandle
mySessionName ReleaseHandle
hwi CloseStack
Errors
Returns the name of the child handle if successful, otherwise an error code.