In the toolbox it is convenient to make a result string to be displayed
in the state panel
The string "Position = (1043.6m-276.6) [mm] Angle = 132.4 [degrees]" is
generated by the following Script contained in a PythonScript tool in the
toolbox. The ExternalText tool PositionStr is connected statepanel as the
parameter.
Example:
#The tool PickPoint contains the position of the valve
x = GetValue('PickPoint.Point_x')
y = GetValue('PickPoint.Point_y')
# The tool PickReference contains the calculated angle of the valve
a = GetValue('PickReference.Angle')
str0 = '= (%(x).1f,%(y).1f) [mm] Angle = %(a).1f [degrees]' %vars()
SetValue('PositionStr.Text',str0)
|