UDE Variable output in shop doc
UDE Variable output in shop doc
(OP)
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
In the shop doc when I tryIt falls over... Yet the following substituted for the last line works
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
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
}
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]
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]
CODE
set AED_Min_X [format $AED_Format "10.54321"]
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!





RE: UDE Variable output in shop doc
RE: UDE Variable output in shop doc
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