The user has created a new custom UDE that includes a point selection field. How can we determine the variable that is assigned to hold the point values, or any other fields in the UDE?
SolutionWhen a UDE is created, NX manufacturing will use the field's assigned variable name to create a mom variable to store that input. As an example, a simple UDE was created in post builder. Note the Variable Name field has been assigned a name of "ude_point":
Inside NX, using this UDE as a start event in an operation shows us the dialog and we can select a point in the setup:
To do anything with this point in the post processor, we need to know what variable(s) to call for output or other manipulation. The easiest method of finding this is to put the UDE in place and post process with the Review Tool enabled. The post event handler for the UDE doesn't have to actually do anything. The post will still process the event and report the variables and their values.
In the Review Tool dialog, choose the MOM_select_point event in the left column. All the variables that exist for that event are now listed in the center column.
A point record will be an array variable. Here the assigned variable name is mom_ude_point_pos. Just as with all coordinate points in NX post processing:
The X coordinate will be mom_ude_point_pos(0)
The Y coordinate will be mom_ude_point_pos(1)
The Z coordinate will be mom_ude_point_pos(2)
If there is a vector/tool axis involved:
The 4th axis rotation value will be mom_ude_point_pos(3)
The 5th axis rotation value will be mom_ude_point_pos(4)
NotesIf you are developing UDEs like this in post configurator, the software gives you a big head start. Taking a look at a similar simple point UDE in the User Defined Events Editor of post configurator, we see the event itself and can get a preview of the dialog. Note the Parameter ID field is the variable name of "selected_point" given by the user:
Here is the advantage in post configurator. The system builds an event handler framework for you, and prepopulates it with a global declaration of all the variables that have been assigned when defining the UDE. In the UDE editor, you can hit the Info button at the bottom to see the contents of this handler:
Note the procedure is framed out, the variables are already listed, and a spot is ready for you to insert whatever code you need to support the UDE data:
You do not need to use the review tool to discover the new mom variables. They are already declared and ready to use.