mdlIObject GetState
The state of an object depends upon three different states: “User State”, “Definable State”, and “If State”. You can only set the “User State” (the checkbox located in the upper right portion of every panel), the other two states are used by MotionView to automatically turn off certain items.
Syntax
mdlIObject_handle GetState
Application
MotionView Tcl Query
Description
Another example is if the “User State” of each graphic is on, all graphics are visible. However, once the body is selected to be deformable, the graphics disappear. This is because the “Definable State” gets set to false, making GetState return false, even through GetUserState will return true.
Example
hwi OpenStack
hwi GetSessionHandle sess1
sess1 GetProjectHandle pro1
pro1 GetPageHandle pa1 [pro1 GetActivePage]
pa1 GetWindowHandle win1 [pa1 GetActiveWindow]
win1 GetClientHandle mc1
mc1 GetModelHandle mod1
mod1 BeginFlatListFastGet Body
set num_body [mod1 GetNumberOfChildren]
set idx [mod1 GetChildHandleByIdx ch_b1 2]
mod1 GetChildHandle bchld [ch_b1 GetVarname]
bchld GetChildHandle bms mass
bms GetState
mod1 GetState
mod1 EndChildFastGet
bms ReleaseHandle;
bchld ReleaseHandle;
mod1 ReleaseHandle;
mc1 ReleaseHandle;
win1 ReleaseHandle;
pa1 ReleaseHandle;
pro1 ReleaseHandle;
sess1 ReleaseHandle;
hwi CloseStack;
Errors
Returns the boolean value of the state: true if right, otherwise false.