cancel
Showing results for 
Search instead for 
Did you mean: 

[Post Builder] output UDE variable.

Solution Partner Builder Solution Partner Builder
Solution Partner Builder

Hi.

 

I want to use UDE to output TEXT values.

The setting for UDE is as follows.

UDE2.jpg

I want to output the value "OUTPUT_TEST".

I do not know what the variable is for output.

5 REPLIES

Re: [Post Builder] output UDE variable.

Valued Contributor
Valued Contributor

Hello! If your question is, how to address the variable in Post: The UDE-variable get the prefix mom_ in Post.

If your UDE-parameter is called info_type then the value of info_type you find in mom_info_type in Post.

 

Werner

Re: [Post Builder] output UDE variable.

Solution Partner Builder Solution Partner Builder
Solution Partner Builder

Hi.

 

I try set in post builder.

 

global mom_info_type

 

MOM_output_literal "TYPE : $mom_info_type"

 

But, Error: can't read "mom_info_type": no such variable
    while executing.

 

 

Re: [Post Builder] output UDE variable.

Esteemed Contributor
Esteemed Contributor

Have you read and understood the NX documentation section about custom UDEs?

You will have to create an event handler called "MOM_{your event name}", where your parameter variables will be valid.

Your parameter variables will be named "mom_{your parameter name}".

If you use post builder to create the UDE, then a proc of the correct name should be created for you.

You must also pay special attention to where you add the UDE, which in turn specifies the point after when the proc will be executed to have the parameters available.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: [Post Builder] output UDE variable.

Esteemed Contributor
Esteemed Contributor

Guessing...

It looks like you want a bunch of parameters for the NC code "Header" (i.e. at the beginning of the program).

 

Note that the UDE data will NOT be available at the "Start of program" event! (there is no way to get a UDE to trigger that early).

 

Before trying to use the UDE variables, I would (in the UDE handler code) just output a line of text, something like:

MOM_output_text "My UDE happens here"

Then try adding it to the top level object in the "program order view" in the ONT (e.g. "NC_Program" object)

 

Then post.

Look at where it is output.

Now arrange your post so you delay output of anything you don't want before the header, to after that event (possibly first toolchange event?)

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: [Post Builder] output UDE variable.

PLM World Member Phenom PLM World Member Phenom
PLM World Member Phenom

Ken brings up a good point.  If you do want this to be at the start of the program you can achieve this using attributes assigned to the PROGRAM object. and a procedure in the post to read the adttributes

 

for example:

 


#
#  Add to start of program procedure for program header
#

   global mom_attr_PROGRAMVIEW_PROGRAM_NUMBER
   global mom_attr_PROGRAMVIEW_PROGRAM_DNCID
   global mom_attr_PROGRAMVIEW_PROGRAM_PART_NAME
   global mom_attr_PROGRAMVIEW_PROGRAM_PART_NUMBER
   global mom_attr_PROGRAMVIEW_OPERATION_SHEET_REV
   global mom_attr_PROGRAMVIEW_PROGRAM_REV
global mom_part_name mom_machine_name mom_definition_file_name
global mom_logname ptp_file_name file_name mom_part_material_description
global mom_date mom_time mom_event_handler_file_name
global mom_spindle_speed mom_output_file_full_name mom_group_name
global mom_sys_control_in mom_sys_control_out ci co


# call in the control in & out codes

set ci " "
set co " "
if {[info exists mom_sys_control_in] == 1 }  { set ci $mom_sys_control_in }
if {[info exists mom_sys_control_out] == 1 }  { set co $mom_sys_control_out }

# get some variables

set postname [lindex [split [file tail $mom_event_handler_file_name] .] 0 ]

 

MOM_set_seq_off
MOM_output_literal ":$mom_attr_PROGRAMVIEW_PROGRAM_NUMBER"
MOM_output_literal "(DNCID$mom_attr_PROGRAMVIEW_PROGRAM_DNCID)"
MOM_output_literal "(PART NUMBER= $mom_attr_PROGRAMVIEW_PROGRAM_PART_NUMBER )"
MOM_output_literal "(PART NAME= $mom_attr_PROGRAMVIEW_PROGRAM_PART_NAME )"
MOM_output_literal "(OPERATION SHEET REV= $mom_attr_PROGRAMVIEW_OPERATION_SHEET_REV )"
MOM_output_literal "(PROGRAM REV= $mom_attr_PROGRAMVIEW_PROGRAM_REV )"
MOM_output_literal "$co PROGRAM DATE= [string range $mom_date 4 6]/[string range $mom_date 8 9]/[string range $mom_date 20 23] [string range $mom_date 11 15], [string toupper $mom_logname] $ci"
MOM_output_literal "()"
MOM_output_literal "$co PART FILE= [string toupper [file tail $mom_part_name]] $ci"
MOM_output_literal "$co OUTPUT FILE= [string toupper $mom_output_file_full_name] $ci"
MOM_output_literal "$co UGPOST NAME= [string toupper $postname] $ci"
MOM_output_literal "$co MACHINE TYPE= [string toupper HORIZONTAL ] $ci"
MOM_output_literal "()"
MOM_output_literal "()"
MOM_set_seq_on

 

In the PROGRAM object set the attributes

 

PROP.JPG

John Joyce, Manufacturing Engineer,
Senior Aerospace Connecticut
www.senioraeroct.com
Production: NX11.0.2.7, Vericut 8.0.3
Development: Tcl/Tk

Learn online





Solution Information