mdlIObject ReplaceEntityAdvanced
Replaces an existing entity with a new entity using MDL statement keywords and the remaining statement tokens.
Syntax
mdlIObject_handle ReplaceEntityAdvancednew_handle, old_handle, keyword, tokens
Application
MotionView Tcl Modify
Description
Inputs
- new_handle
- The handle for the new entity.
- old_handle
- The handle of the current entity.
- keyword
- The entity's MDL statement keyword.
- tokens
- The remaining tokens for the corresponding MDL statement.
Example
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 pt0 PointPair p_0 "\"Point Pair\"";
myModelName InterpretSet SetPoint p_0 "" 0.0 50.0 50.0 0.0 -50 50;
myModelName InterpretEntity mark_handle Marker mrk_0 "\"Marker 0\"" B_Ground P_Global_Origin "FLOATING";
pt0 ReleaseHandle;
myModelName Evaluate;
myModelName BeginFlatListFastGet "Point"
myModelName GetChildHandleByIdx point_handle 2
set pointvar [point_handle GetFullVarname]
tk_messageBox -message "$pointvar";
myModelName EndChildFastGet
myModelName ReplaceEntityAdvanced newmark_handle mark_handle Marker B_Ground $pointvar Floating;
newmark_handle ReleaseHandle
point_handle ReleaseHandle
myModelName ReleaseHandle
myClientName ReleaseHandle
myWindowName ReleaseHandle
myPageName ReleaseHandle
myProjectName ReleaseHandle
mySessionName ReleaseHandle
hwi CloseStack
Errors
Returns 0 if successful, otherwise an error code.
or
Returns the name of the new_handle (in the example above it returns "newmark_handle").