Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

UDE Variable output in shop doc

Status
Not open for further replies.

pracslipkerm

Mechanical
Dec 17, 2008
58
Hi Everyone,
I have a UDE that gets the min and max dimensions in X,Y & Z that I output in the post to get the block form. I am now trying to get them out of the shop doc.
Here is the command out of post builder
Code:
# This procedure formats variables from UDE and outputs block form in program
global mom_AED_Min_X
global mom_AED_Min_Y
global mom_AED_Min_Z
global mom_AED_Max_X
global mom_AED_Max_Y
global mom_AED_Max_Z
global AED_Min_X
global AED_Min_Y
global AED_Min_Z
global AED_Max_X
global AED_Max_Y
global AED_Max_Z
global AED_Format
global AED_Blk_Frm

#check if first call of procedure (Set to 0 in program start sequence)
if { $AED_Blk_Frm == 0 } {

#Format values as required
  #set AED_Format "%#i"
  set AED_Format "%#4.1f"
  set AED_Min_X [format $AED_Format $mom_AED_Min_X]
  set AED_Min_Y [format $AED_Format $mom_AED_Min_Y]
  set AED_Min_Z [format $AED_Format $mom_AED_Min_Z]
  set AED_Max_X [format $AED_Format $mom_AED_Max_X]
  set AED_Max_Y [format $AED_Format $mom_AED_Max_Y]
  set AED_Max_Z [format $AED_Format $mom_AED_Max_Z]

MOM_output_literal "BLK FORM 0.1 Z X${AED_Min_X} Y${AED_Min_Y} Z${AED_Min_Z}"
MOM_output_literal "BLK FORM 0.2 X${AED_Max_X} Y${AED_Max_Y} Z${AED_Max_Z}"
}

# Set variable to 1 to prevent output with every toolpath
set AED_Blk_Frm 1
}

In the shop doc when I try
Code:
  global mom_AED_Min_X
  global mom_AED_Min_Y
  global mom_AED_Min_Z
  global mom_AED_Max_X
  global mom_AED_Max_Y
  global mom_AED_Max_Z
  
  set AED_Format "%#4.1f"
  set AED_Min_X [format $AED_Format $mom_AED_Min_X]
It falls over... Yet the following substituted for the last line works
Code:
  set AED_Min_X [format $AED_Format "10.54321"]
Anyone know what I am doing wrong???
Can I access the values AED_Min_X etc from the post???
If I enter a value instead of $mom_AED_Min_X it works...
Thanks in Advance

Cheers
Steve Griffiths :)

If you want to make apple pie from scratch, first you must create the universe!
 
Replies continue below

Recommended for you

In your logfile is it saying the variable doesn't exist? I am not sure if UDE variables are available in shop docs. If that is true then setting the variable before outputting, or just replacing it with a value as you did should, work then. Are you on the GTAC website? There are threads on this same question. I don't use shop docs so don't know much about them. Good Luck.
 
UDE variables that are collected in the NX are available.

Variables that are produced as part of the OUTPUT of the UDE in the post are not available. You have to postprocess to get those variables.

The easiest thing is to turn on the review tool in your shopdocs and look at the events and variables being provided. The lines to do this are in the OOTB samples, but commented out.

Mark Rief
Product Manager
Siemens PLM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor