ug后处理定制的命令
更新时间:2023-09-07 08:49:01 阅读量: 教育文库 文档下载
学习UG后处理的文档 自己写的,全部上机实验过
在pd_cmd_custom_command(用户自定义)——定义命令
1.在程序的末尾加上加工的时间(注意字符间的空格,不能少也不能多)
global mom_machine_time
MOM_output_literal (运行时间:[ format %.2f $mom_machine_time]分钟)
最后效果:(运行时间:0.76分钟)
2.在程序末尾加上生成程序的时间
global mom_date
MOM_output_literal ";date is :$mom_date"
最后效果:;date is :Sat Jun 01 19:38:44 2013
3.加入刀具列表
# Place this custom command in either the start of program
# or the end of program event marker to generate a tool list
# in your NC file.
#
# The Shop Doc template file "pb_post_tool_list.tpl" distributed with
# Post Builder in "POSTBUILD/pblib/misc" directory can be copied
# to the "mach/resource/postprocessor" or "mach/resource/shop_docs" directory,
# in case that your UG runtime environment does not have access to the
# Post Builder installation.
#
# Accessing "pb_post_tool_list.tpl" in other location can also be accomplished
# by changing the code below titled "Generate tool list data" in this proc.
#
# The variable "mom_sys_tool_list_output_type" set in this proc allows you
# to select the type of tool list to be generated.
# The options are:
#
# "ORDER_IN_USE" - List tools used in the program in the order of operations.
# "ALL_UNIQUE" - List all unique tools once for each in the order of use.
# "GROUP_BY_TYPE" - List tools in groups of different tool types.
#
# The desired tool list type can be set by changing the code below.
# The default is set to "GROUP_BY_TYPE".
#
global mom_sys_tool_list_initialized
global mom_sys_tool_list_output_type
if { ![info exists mom_sys_tool_list_initialized] || !$mom_sys_tool_list_initialized } {
MOM_output_to_listing_device "proc PB_CMD_init_tool_list must be executed in the
Start of Program before PB_CMD_create_tool_list is called."
return
学习UG后处理的文档 自己写的,全部上机实验过
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++
# Set mom_sys_tool_list_output_type to the desired output fashion.
#
# "ORDER_IN_USE" - List tools used in the program in the order of operations.
# "ALL_UNIQUE" - List all unique tools once for each in the order of use.
# "GROUP_BY_TYPE" - List tools in groups of different tool types.
#
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++
# set mom_sys_tool_list_output_type "ORDER_IN_USE"
# set mom_sys_tool_list_output_type "ALL_UNIQUE"
set mom_sys_tool_list_output_type "GROUP_BY_TYPE"
global mom_sys_control_out mom_sys_control_in
global current_program_name
global mom_tool_number mom_tool_length_adjust_register mom_tool_name
#----------------------------------------------------------------------------
# Save info for the currently active tool in the program being post-prcessed
# before starting Shop Doc mechanism for tool list generation.
#----------------------------------------------------------------------------
if [llength [info commands PB_CMD_save_active_oper_tool_data] ] {
PB_CMD_save_active_oper_tool_data
}
#-----------------------------------------------------------
# Create tool list per selected top-level group.
# Group name is set to blank if no group has been selected.
#-----------------------------------------------------------
global mom_parent_group_name
if [info exists mom_parent_group_name] {
set current_program_name $mom_parent_group_name
} else {
set current_program_name ""
学习UG后处理的文档 自己写的,全部上机实验过
set ci " "
set co " "
if [info exists mom_sys_control_in] { set ci $mom_sys_control_in }
if [info exists mom_sys_control_out] { set co $mom_sys_control_out }
#*************************
# Generate tool list data
#*************************
set template_file pb_post_tool_list.tpl
global tcl_platform
if [string match "windows" $tcl_platform(platform)] {
set pb_lib_misc_dir [MOM_ask_env_var UGII_BASE_DIR]\\postbuild\\pblib\\misc\\
} else {
set pb_lib_misc_dir [MOM_ask_env_var UGII_BASE_DIR]/postbuild/pblib/misc/
}
set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR]
set cam_shop_doc_dir [MOM_ask_env_var UGII_CAM_SHOP_DOC_DIR]
if { [file exists ${pb_lib_misc_dir}${template_file}] } {
MOM_do_template_file ${pb_lib_misc_dir}${template_file}
} elseif { [file exists ${cam_post_dir}${template_file}] } {
MOM_do_template_file ${cam_post_dir}${template_file}
} elseif { [file exists ${cam_shop_doc_dir}${template_file}] } {
MOM_do_template_file ${cam_shop_doc_dir}${template_file}
} else {
MOM_output_to_listing_device "ERROR : Template file pb_post_tool_list.tpl is not
found in the following directories: \n \n $pb_lib_misc_dir \n $cam_post_dir \n $cam_shop_doc_dir \n \n Tool list cannot be generated.\n"
return
}
学习UG后处理的文档 自己写的,全部上机实验过
#------------------
# Tool list header
#------------------
shop_doc_output_literal
"$co==================================================================
=============================$ci"
shop_doc_output_literal "$co T O O L L I S T $ci"
shop_doc_output_literal
"$co==================================================================
=============================$ci"
#------------------
# Output tool list
#------------------
global tool_data_buffer
global mom_sys_tool_stack
switch $mom_sys_tool_list_output_type {
"ORDER_IN_USE" {
set tool_list $mom_sys_tool_stack(IN_USE)
}
"GROUP_BY_TYPE" {
set tool_list [concat $mom_sys_tool_stack(LATHE) $mom_sys_tool_stack(DRILL)
$mom_sys_tool_stack(MILL)]
}
default {
set tool_list $mom_sys_tool_stack(ALL)
}
}
set prev_tool_type ""
foreach tool $tool_list {
set tool_type $tool_data_buffer($tool,type)
学习UG后处理的文档 自己写的,全部上机实验过
# Output tool type header if it changes.
if { ![string match "$tool_type" $prev_tool_type] } {
if { [info exists tool_data_buffer($tool_type,header)] && $tool_data_buffer($tool_type,header) != "" } {
shop_doc_output_literal "$tool_data_buffer($tool_type,header)"
}
}
if [info exists tool_data_buffer($tool,output)] {
shop_doc_output_literal "$tool_data_buffer($tool,output)"
}
set prev_tool_type $tool_type
}
#------------------
# Tool list footer
#------------------
shop_doc_output_literal
"$co===============================================================================================$ci"
#-------------------------------------------------------------------------------
# Restore info for the currently active tool in the program being post-prcessed.
#-------------------------------------------------------------------------------
if [llength [info commands PB_CMD_restore_active_oper_tool_data] ] {
PB_CMD_restore_active_oper_tool_data
}
学习UG后处理的文档 自己写的,全部上机实验过
结果:
(===============================================================================================)
( T O O L L I S T )
(===============================================================================================)
( )
(-----------------------------------------------------------------------------------------------)
(MILL DESCRIPTION DIAMETER COR RAD FLUTE LEN ADJ REG MACH TIME )
(-----------------------------------------------------------------------------------------------)
(D10 MILL 10.0000 0.0000 50.0000 0 0.16 )
(D6R3 MILL 6.0000 3.0000 50.0000 0 0.20 )
(D4 MILL 4.0000 0.0000 50.0000 0 0.23 )
(===============================================================================================)
5.插入刀具详细信息
global mom_tool_name mom_tool_diameter mom_tool_corner1_radius mom_tool_number mom_tool_length mom_tool_flute_length
MOM_output_literal "(T_N:$mom_tool_name T_D:[ format "%.2f" $mom_tool_diameter] T_R:[ format "%.2f" $mom_tool_corner1_radius] T_NO.:$mom_tool_number T_L:[ format "%.2f" $mom_tool_length] T_F_L:[ format "%.2f" $mom_tool_flute_length] )"
效果:(T_N:D10 T_D:10.00 T_R:0.00 T_NO.:1 T_L:75.00 T_F_L:50.00 )
学习UG后处理的文档 自己写的,全部上机实验过
在运算程序消息
1.MOM_output_literal “( 刀具名称:$mom_tool_name )”
2.MOM_output_literal “( 刀具直径:$mom_tool_diameter )”
3.MOM_output_literal “( 刀具R角半径:$mom_tool_nose_radius )”
正在阅读:
ug后处理定制的命令09-07
上海夜间施工方案05-05
卫生经济学试题12-07
网站的静态网页实现技术08-13
职业生涯人物访谈总结报告11-18
联轴器习题11-24
新概念英语 第四册课文09-05
2013-2014六语上册期中试卷及答案12-22
地暖用户增容改管流程(新123)06-07
浙大中控DCS上机练习题04-19
- exercise2
- 铅锌矿详查地质设计 - 图文
- 厨余垃圾、餐厨垃圾堆肥系统设计方案
- 陈明珠开题报告
- 化工原理精选例题
- 政府形象宣传册营销案例
- 小学一至三年级语文阅读专项练习题
- 2014.民诉 期末考试 复习题
- 巅峰智业 - 做好顶层设计对建设城市的重要意义
- (三起)冀教版三年级英语上册Unit4 Lesson24练习题及答案
- 2017年实心轮胎现状及发展趋势分析(目录)
- 基于GIS的农用地定级技术研究定稿
- 2017-2022年中国医疗保健市场调查与市场前景预测报告(目录) - 图文
- 作业
- OFDM技术仿真(MATLAB代码) - 图文
- Android工程师笔试题及答案
- 生命密码联合密码
- 空间地上权若干法律问题探究
- 江苏学业水平测试《机械基础》模拟试题
- 选课走班实施方案
- 定制
- 命令
- 处理
- 9月川菜新菜品推广会招商方案
- 中国装修行业发展前景预测与投资战略规划分析报告2015-2020年
- 第15章 电泳分离技术
- 人教版八年级上册数学说教材
- 可持续发展理念辩析城市化新进程
- 五年级上册英语期中考试试题
- 西南大学网络与继续教育学院《计算机应用基础》作业参考答案
- 鲁教版初一政治上册教案全套
- 管理学概论第一次离线作业
- 人教新目标八年级(上)Unit2 Section A-1
- 超星数字图书馆的使用说明
- 课题3 水的组成
- 075.区域医疗信息系统的安全审计探讨——赖炜 郭清顺 辛小霞
- OMG美语-最新美国俚语总结-EXCEL
- 金蝶K3 V12.3 财务分析系统用户手册
- 如何学好法理学
- 2010年大学英语四级备考资料下载汇总
- 自考英语二6A teaching children to spend pocket money wisely
- 二年级上册期中考试数学试卷(最新人教版)
- 货币银行学金融监管