易寒冷锋 发表于 2026-4-8 20:02:25

NX6.0,读取主坐标系各偏置坐标系原点坐标的TCL文件怎么写

一个工件,每个面都建坐标系,以一个坐标系为主坐标系,作为父系,其余的为局部坐标系作为子系,怎么用tcl写读取子坐标系在主坐标系中的坐标值

快乐皆度 发表于 2026-4-8 21:20:29

唔知,等大佬

皮休111 发表于 2026-4-8 21:50:50

等大神解答

易寒冷锋 发表于 2026-4-9 11:49:51

proc PB_CMD_collect_point { } {
#=============================================================
global mom_operation_name suppress_all_output
global mom_main_mcs
global mom_main_mcs_fixture_offset_pos
global mom_fixture_offset_value
global mom_fixture_offset_value
    set fix $mom_fixture_offset_value
global mom_pos
global xmin xmax
global ymin ymax
global zmin zmax
global amin amax
global mom_out_angle_pos
if {$xmin > $mom_pos(0)} { setxmin $mom_pos(0)}
if {$xmax < $mom_pos(0)} { setxmax $mom_pos(0)}
if {$ymin > $mom_pos(1)} { setymin $mom_pos(1)}
if {$ymax < $mom_pos(1)} { setymax $mom_pos(1)}
if {$zmin > $mom_pos(2)} { setzmin $mom_pos(2)}
if {$zmax < $mom_pos(2)} { setzmax $mom_pos(2)}
if {$amin > $mom_out_angle_pos(0)} { setamin $mom_out_angle_pos(0)}
if {$amax < $mom_out_angle_pos(0)} { setamax $mom_out_angle_pos(0)}
global mom_template_type
global mom_out_angle_pos
global mom_tool_adjust_register
global dtj
set x_out $mom_pos(0)
    set y_out $mom_pos(1)
    set z_out $mom_pos(2)
    set b_out $mom_out_angle_pos(0)
    set x_fmt
    set y_fmt
    set z_fmt
    set b_fmt
if {$dtj == 0} {
if {$fix >= 1} {
      MOM_output_literal "G"
    } elseif {$fix < 0} {
      # 负数 → G54.1 Pxx
      MOM_output_literal "G54.1 P"
    } else {
      # 其他默认G54
      MOM_output_literal "G54"
    }

MOM_output_literal "G0 G90 B"
MOM_output_literal "G0 G90 G94 G43 M08 Z H"
}
set dtj 1.0
}
}
我这个程序错在哪。请大神帮忙

zhousd007 发表于 2026-4-9 13:26:12

完全搞不懂

zajfdiskzaj 发表于 2026-4-9 13:49:34

易寒冷锋 发表于 2026-4-9 11:49
proc PB_CMD_collect_point { } {
#=============================================================
globa ...

:L:L:L:L:L:L:L:L
页: [1]
查看完整版本: NX6.0,读取主坐标系各偏置坐标系原点坐标的TCL文件怎么写