mdlIDataMember SetRawExpression
Used to set expressions for a data members.
Syntax
mdlIDataMember_handle SetRawExpression expr
Application
MotionView Tcl Modify
Description
This command sets expressions for a data members.
Inputs
- expr
- The value to be assigned to the data member.
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
set body_mass [bms GetEvaluatedValue];
set new_mass [expr $body_mass + 10];
bms SetRawExpression $new_mass
bms Evaluate;
mod1 Evaluate;
mod1 EndChildFastGet
bms ReleaseHandle;
bchld ReleaseHandle;
mod1 ReleaseHandle;
mc1 ReleaseHandle;
win1 ReleaseHandle;
pa1 ReleaseHandle;
pro1 ReleaseHandle;
sess1 ReleaseHandle;
hwi CloseStack;
Errors
Returns Success (0) or an error code.