NX
extracting point values from a User Defined Event
2021-10-06T23:27:56Z
NX for Manufacturing
Summary
Details
When creating a custom User Defined Event (UDE) that has the user select a point, how do we extract the point's XYZ values for use later in the post?
Solution
The point selected in the UDE is stored as an array variable, just as any other position data in an NX operation.
To see how this is accessed, we will work through a basic sample, assuming that the user is already aware of how to create UDEs in post builder and edit the proper ude.cdl file.
First, create a UDE that just asks for a point. That selected point is stored in the "my_point" variable:
When this is active within NX, the dialog for the UDE will look like this: With that event added to an operation, postprocess using any post with the review tool turned on. There is no need to have anything actually in the post to handle the event. All we need to do is get the variables being used as the post encounters this new custom event, and the review tool lets us see that. Note that the "my_point" variable name from the UDE was converted (as expected) to a "mom_my_point" variable as an array, and the XYZ values for the selected point are stored in array indexes 0, 1, and 2:
In the post custom command where this point data is to be used, you would declare the general variable and then pull out the array values you want using their index number. For example:
================================================
global mom_my_point
set myX $mom_my_point(0) set myY $mom_my_point(1) set myZ $mom_my_point(2)
MOM_output_literal " point location is: X=$myX Y=$myY Z=$myZ"
================================================
Hardware/Software Configuration
Platform: all OS: n/a OS Version: n/a Product: NX Application: CAM Version: V1953 Function: USER_DEF_EVENT