把UG车间文档原代码进行了更改,可以将加工信息直接反应出来了,便于自动出程序单编辑人员使用,原代码如下!
######################################################################
# S H O P D O C _ P R O G R A M V I E W _ T E X T . T C L
######################################################################
# EVENT HANDLER SECTION
# This section contains the control section for creating an operation list
#
# CAM will loop thru each event in the path and call the procedure
# whose name is the name of the event.
#
#
#
#
#_______________________________________________________________________________
# Here you should define any global variables that will be used in any one
# of the event handler.
#_______________________________________________________________________________
set mom_source_directory [MOM_ask_env_var UGII_CAM_SHOP_DOC_DIR]
source "$mom_source_directory/shopdoc_header.tcl"
set line_flag 0
set template_type ""
set template_subtype "",https://www.qqlove123.com
# This procedure creates a part documentation.
#_______________________________________________________________________________
#==============================================================================
proc MOM_Start_Part_Documentation {} {
#==============================================================================
# Calls the shopdocs header
global mom_sys_output_file_suffix
set mom_sys_output_file_suffix "txt"
#===============================================================================
# Operation
#===============================================================================
#===============================================================================
proc MOM_OPER_BODY { } {
#===============================================================================
global mom_template_type
global mom_template_subtype
global template_type
global template_subtype
global mom_operation_name
global mom_operation_type
set template_type $mom_template_type
set template_subtype $mom_template_subtype
if { $mom_operation_type == "Wire EDM" } \
{
set oper_desc "$template_type/$template_subtype"
set output [format "%-30s %-35s %5s \n" $mom_operation_name \
$oper_desc "WIRE"]
MOM_output_literal "$output"
}
}
#==============================================================================
proc MOM_TOOL_BODY {} {
#==============================================================================
global mom_operation_name
global mom_operation_type
global template_type
global template_subtype
global mom_tool_name
global line_flag
global mom_stock_part
global mom_stepover_distance
global mom_tool_length
global mom_inside_outside_tolerances
set oper_name "OPERATION NAME"
set oper_type "OPERATION DESCRIPTION"
set tool_name "TOOL NAME"
set stock_part "STOCK"
set stepover_distance "stepover"
set tool_length "length"
set inside_outside_tolerances(0) "toll in"
set inside_outside_tolerances(1) "toll out"
#==============================================================================
proc MOM_PROGRAMVIEW_FTR {} {
#==============================================================================
}
#==============================================================================
proc MOM_PROGRAM_BODY {} {
#==============================================================================
global mom_member_nest_level
global mom_object_name
global line_flag
global mom_stock_part
global mom_stepover_distance
global mom_tool_length
global mom_inside_outside_tolerances
set oper_name "OPERATION NAME"
set oper_type "OPERATION DESCRIPTION"
set tool_name "TOOL NAME"
set stock_part "STOCK"
set stepover_distance "步距"
set tool_length "刀长"
set inside_outside_tolerances(0) "内公差"
set inside_outside_tolerances(1) "外公差"
if {$line_flag} \
{
MOM_output_literal "-----------------------------------------------------------------------------------------------"
MOM_output_literal " "
set line_flag 0
}
set output [format "PROGRAM NAME : %-25s" $mom_object_name]
MOM_output_literal "$output"
# puts the header only for the operations
MOM_output_literal "-----------------------------------------------------------------------------------------------"
set output [format "%-30s %-35s %-25s %-25s %-25s %-25s %-25s %-25s" $oper_name $oper_type $tool_name $stock_part $stepover_distance $tool_length $inside_outside_tolerances(0) $inside_outside_tolerances(1)]
MOM_output_literal $output
MOM_output_literal "-----------------------------------------------------------------------------------------------"
set line_flag 1
}
#==============================================================================
proc MOM_MEMBERS_FTR {} {
#==============================================================================
global line_flag
if {$line_flag} \
{
MOM_output_literal "-----------------------------------------------------------------------------------------------"
MOM_output_literal " "
set line_flag 0
}
}