Showing results for 
Search instead for 
Do you mean 
Solved! Go to solution

UDE defined in Geometry

I am trying to figure out a way for a post to be able to tell if a certain UDE has been added to the Geometry being used by an operation, so that I can output a warning and abort the post if it is not. Any suggestions?


Re: UDE defined in Geometry

[ Edited ]

Do you need to check if UDE is set to specific object in Geometry View, or to check if UDE is added to any parent object?


If you mean second case, it should be very easy

Marek Pawlus, NCmatic

Production: NX 11.0.1
Development: C#, Tcl/Tk, CSE

Re: UDE defined in Geometry

I need to be able to check if a UDE has been added to a geometry parent object. I found a command called MOM_list_user_defined_events, but it says it is for listing UDE's in operations, it doesn't mention geometry.

Accepted by MarkRief (VIP)
‎10-29-2015 01:45 PM

Re: UDE defined in Geometry

What I'm guessing you'll have to do:

In the UDE, check what the parent is. (could be hard to see exactly what the parent is, maybe check the event?)

You can also check mom_sys_in_operation to see if you are in an operation.

if you aren't in an operation, and the parent is correct, set a flag that everything's OK.


Then later (e.g. "Start of path") make sure the flag is OK.


Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled

Re: UDE defined in Geometry

[ Edited ]

I figured out a way to get it done.


What I did was, in Postbuilder at the start off the Machine Control Event that the UDE is looking to,  I used

set event [MOM_ask_event_type]

to get the name of the UDE, then at the end of the MCE I used


set last_geom_event "$mom_oper_geom $event"

to tie the UDE name to the Geometry being used and the $mom_oper_geom part will only be updated if the UDE is processed with the next Geometry used.



Then in Start of Path I used

if {$last_geom_event != "$mom_oper_geom MOM_ude_name"} {MOM_abort}

where MOM_ude_name is the actual name of the Event I am checking for. So that for every operation, if a new Geometry is being used and it does not have the UDE added, the last_geom_event variable will still be defined with the previous $mom_oper_geom.



May not be the most elegant way of getting the job done, but it does the job.

Learn online

Solution Information