mdlIObject GetObjectHandleFromSymbol
Gets the handle of an entity using a known symbol (for example, variable name).
Syntax
mdlIObject_handle GetObjectHandleFromSymbol obj_handle, symbol
Application
MotionView Tcl Query
Description
This command obtains the handle of an entity using a known symbol (for example, variable name). This reduces effort and obviates the need to obtain the intermediate child handles.
Inputs
- obj_handle
- The name of the handle to the object.
- symbol
- An identification of the object.
Example
To get the handle of a point and then erase the point:
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 InterpretEntity newpt Point test_point "\"Test Point\"";
myModelName InterpretSet SetPoint test_point 50.0 50.0 50.0;
newpt ReleaseHandle;
myModelName Evaluate
myModelName GetObjectHandleFromSymbol obj_hand test_point
obj_hand CutObject
obj_hand ReleaseHandle
myModelName ReleaseHandle
myClientName ReleaseHandle
myWindowName ReleaseHandle
myPageName ReleaseHandle
myProjectName ReleaseHandle
mySessionName ReleaseHandle
hwi CloseStack
Note: The
intermediate point_handle has been skipped since the symbol was
directly used to obtain the handle.
Errors
Returns the name of the handle if successful, otherwise an error message.