mdlIObject EvaluateEntityTemplate

Creates and evaluates a temporary Templex template using the user-provided text.

Syntax

mdlIObject_handle EvaluateEntityTemplateraw_text, num_args

Application

MotionView Tcl Modify

Description

This command is a Tcl version of a Templex template. It works in the context of the (system) object, it is being called on. For example, if you are working in system A, then the EvaluateEntityTemplate command will evaluate only the objects within that system. If you are unable to grab the point handle, first try grabbing the system handle (which has two or more points) and then get the point handle.

Inputs

raw_text
‘Raw’ text means that it is text before being processed by Templex. After it has been processed, the text is then called ‘evaluated’ text.
num_args

Example

To evaluate a data-member in a system:
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 System
myModelName GetChildHandleByIdx sys1 2
sys1 BeginFlatListFastGet Point
sys1 GetChildHandleByIdx point_1      2
set p_label [point_1 GetLabel]
set val [point_1 EvaluateEntityTemplate "x" ]
tk_messageBox -message "The Evaluated Value of $p_label is $val"
#Now we go into another system and try to evaluate the x-value of the same point_1 #
sys1 EndChildFastGet
myModelName GetChildHandleByIdx sys2  3
set newval [sys2 EvaluateEntityTemplate "point_1.x"]
puts $newval
#Note that this time the x-value does not get evaluated"
myModelName EndChildFastGet
point_1 ReleaseHandle
sys2 ReleaseHandle
sys1 ReleaseHandle
myModelName ReleaseHandle
myClientName ReleaseHandle
myWindowName ReleaseHandle
myPageName ReleaseHandle
myProjectName ReleaseHandle
mySessionName ReleaseHandle
hwi CloseStack

Errors

Returns the evaluated value of the template.