Sensor Model | G2xxx, G3xxx, G4xxx, G5xxx |
Firmware Version | GoPxL 1.1.x.x |
SDK Version | n/a |
Question
How can I use Script tool to generate anchor values for another tools?
Answer
In GoPxL, Script tools offers a functionality to use output values as anchors for other tools and also user is able to generate geometrical objects, such as point, line, circle, in order to use them as features in other tools.
The Script, in the example below, takes two points and calculates their middle point.
There are three Inputs in the Script:
- Uniform Profile from Surface Section tool - used only for visualization purposes
- Point from Profile Position Left tool - point geometrical feature
- Point from Profile Position Right tool - point geometrical feature
There are three Outputs in the Script:
- Output 0 - Measurement type - X position of the middle point
- Output 1 - Measurement type - Z position of the middle point
- Output 2 - Point type - middle point as geometrical feature
You can see the code from the Script below. It just takes two input points' X and Z coordinates and calculates X and Z coordinates of the point lying in the middle of them.
left_point = get_point(1).position
right_point = get_point(2).position
middle_point_x = (left_point.x + right_point.x) / 2
middle_point_z = (left_point.z + right_point.z) / 2
middle_point = Point3d(x=middle_point_x, z=middle_point_z)
send_measurement(0, middle_point_x)
send_measurement(1, middle_point_z)
send_point(2, middle_point)
In result user can use two output measurements (Output 0 and Output 1) as an anchors for another tool (here for Profile Dimension tool).
And also point output (Output 2) as feature point for example for Feature Dimension tool.
You can find more information about the Script tool in the GoPxL documentation:
Comments
0 comments
Please sign in to leave a comment.