找回密码 注册 QQ登录
开思网工业级高精度在线3D打印服务

iCAx开思网

CAD/CAM/CAE/设计/模具 高清视频【积分说明】如何快速获得积分?在线3D打印服务,一键上传,自动报价 
查看: 23010|回复: 3
打印 上一主题 下一主题

[分享] 用于制作自动程序单的UG车间文件源代码

[复制链接]
跳转到指定楼层
1
发表于 2010-12-12 15:49:44 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多同行朋友,交流,分享,学习。

您需要 登录 才可以下载或查看,没有帐号?注册

x
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"


    Open_Files
    ShopDoc_Header_text

}
#==============================================================================
proc MOM_Part_Documentation {} {
#==============================================================================

    MOM_do_template_file "[MOM_ask_env_var UGII_CAM_SHOP_DOC_DIR]shopdoc_programview_text.tpl"
}

#==============================================================================
proc MOM_End_Part_Documentation {} {
#==============================================================================

}
#===============================================================================
# Setup
#===============================================================================
#==============================================================================
proc MOM_SETUP_HDR {} {
#==============================================================================

  # Calls the setup header
    Setup_Header_text

}

#==============================================================================
proc MOM_SETUP_BODY {} {
#==============================================================================
  global mom_template_type
  global mom_template_subtype

  MOM_output_literal "                        OPERATION  LIST BY PROGRAM"
  MOM_output_literal "                        *********  **** ** *******"
}


#==============================================================================
proc MOM_SETUP_FTR {} {
#==============================================================================

}

#===============================================================================
# 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"


  if {!$line_flag} \,https://www.fzl1314.com
  {
    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
  }

  if { $template_type == ""  && $template_subtype == ""} \
  {
      set oper_desc "--/--"
  } elseif { $template_type == "" } \
  {
      set oper_desc "--/"
      append oper_desc $template_type
  } elseif { $template_subtype == ""} \
  {
      set oper_desc "$template_type/"
      append oper_desc "--"
  } else \
  {
      set oper_desc "$template_type/$template_subtype"
  }

  set output [format "%-30s %-35s %-25s %-25s %-25s %-25s %-25s %-25s\n" $mom_operation_name \
                          $oper_desc $mom_tool_name $mom_stock_part $mom_stepover_distance $mom_tool_length $mom_inside_outside_tolerances(0) $mom_inside_outside_tolerances(1)]
  MOM_output_literal "$output"
  set template_type ""
  set template_subtype ""
}

proc MOM_PROGRAMVIEW_HDR {} {
   global mom_member_nest_level
}


#==============================================================================
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
   }
}


#==============================================================================
proc MOM_MEMBERS_HRD {} {
#==============================================================================
}
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 赞一下!赞一下!
2
发表于 2010-12-17 13:40:45 | 只看该作者

马上注册,结交更多同行朋友,交流,分享,学习。

您需要 登录 才可以下载或查看,没有帐号?注册

x
3
发表于 2012-4-14 23:18:49 | 只看该作者

马上注册,结交更多同行朋友,交流,分享,学习。

您需要 登录 才可以下载或查看,没有帐号?注册

x
4
发表于 2012-8-4 14:49:22 | 只看该作者

马上注册,结交更多同行朋友,交流,分享,学习。

您需要 登录 才可以下载或查看,没有帐号?注册

x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3D打印手板模型快速制作服务,在线报价下单!

QQ 咨询|手机版|联系我们|iCAx开思网  

GMT+8, 2024-9-21 02:43 , Processed in 0.036025 second(s), 13 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

快速回复 返回顶部 返回列表