教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 文库大全 > 小学教育 >

ug后处理定制的命令

来源:网络收集 时间:2026-01-29
导读: 学习UG后处理的文档 自己写的,全部上机实验过 在pd_cmd_custom_command(用户自定义)——定义命令 1.在程序的末尾加上加工的时间(注意字符间的空格,不能少也不能多) global mom_machine_time MOM_output_literal (运行时间:[ format %.2f $mom_machine_

学习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=== …… 此处隐藏:4271字,全部文档内容请下载后查看。喜欢就下载吧 ……

ug后处理定制的命令.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wenku/39738.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)