200014 发表于 2024-10-23 14:59:59

xx1314365 发表于 2024-10-23 13:10
还是有点小问题,单个工序输出后处理,会输出余量,所有程序一起后处理就不显示余量了,还是求大神改一下

此位置添加后,在ptoolcomment处写入*xy_stock和那个,要强制输出

200014 发表于 2024-10-23 15:01:03

xx1314365 发表于 2024-10-23 13:10
还是有点小问题,单个工序输出后处理,会输出余量,所有程序一起后处理就不显示余量了,还是求大神改一下

第二个如果出现重复则在ptoolend让那两个代码=0即可
。。。=0

xx1314365 发表于 2024-10-23 15:21:52

200014 发表于 2024-10-23 15:01
第二个如果出现重复则在ptoolend让那两个代码=0即可
。。。=0

没明白,还是帮帮改一下先

xx1314365 发表于 2024-10-23 16:04:05

还是有点小问题,单个工序输出后处理,会输出余量,所有程序一起后处理就不显示余量了,还是求大神改一下

xx1314365 发表于 2024-10-23 17:52:43

没有人会吗

CY791231* 发表于 2024-10-23 22:44:42

已改测试一下

佛卍訫 发表于 2024-10-24 09:33:03

大神你的时间显示怎么弄的

chunlin0105 发表于 2024-10-24 10:01:22

谢谢分享   

疯狂的铣叨 发表于 2024-10-24 10:12:40

原创 若枫oneZone若枫oneZone 2022-10-21 08:30 发表于江苏

1:首先定义开关及初始数据:

oneZone_stock_to_leave : yes$#Output stock to leave information?
squery_invalid : "-99999" #Invalid return value from query functions
sstock         : ""
Mastercam后处理刀具清单输出刀具加工深度源码--方法1



2:预留量函数初始数据


#Enhanced Tool Table Variables
stock_index      : 0
wall_stock       : 0
floor_stock      : 0
max_wall_stock   : 0
min_wall_stock   : 0
max_floor_stock: 0
min_floor_stock: 0
Mastercam后处理 3+2刀尖跟随计算源代码

3:定义各操作类型



WALL_STOCK@      : 1
FLOOR_STOCK@   : 2
LOW@             : -999999
HIGH@            : 999999


#tool_op$ Code Enumerators
TOOL_OP_CONTOUR@ : 1
TOOL_OP_DRILL@ : 2
TOOL_OP_POCKET@ : 3
TOOL_OP_TRANSFORM@ : 4
TOOL_OP_MULTISURF_ROUGH_PARALLEL@ : 5
TOOL_OP_MULTISURF_ROUGH_RADIAL@ : 6
TOOL_OP_MULTISURF_ROUGH_PROJECT@ : 7
TOOL_OP_MULTISURF_ROUGH_FLOWLINE@ : 8
TOOL_OP_MULTISURF_ROUGH_CONTOUR@ : 9
TOOL_OP_MULTISURF_ROUGH_POCKET@ : 10
TOOL_OP_MULTISURF_FINISH_PARALLEL@ : 11
TOOL_OP_MULTISURF_FINISH_RADIAL@ : 12
TOOL_OP_MULTISURF_FINISH_PROJECT@ : 13
TOOL_OP_MULTISURF_FINISH_FLOWLINE@ : 14
TOOL_OP_MULTISURF_FINISH_CONTOUR@ : 15
TOOL_OP_C_HOOK@ : 16
TOOL_OP_MANUAL_ENTRY@ : 17
TOOL_OP_CIRCLE_MILL@ : 18
TOOL_OP_POINT@ : 19
TOOL_OP_TRIMMED@ : 20
TOOL_OP_RULED@ : 21
TOOL_OP_REVOLVED@ : 22
TOOL_OP_LETTERS@ : 23
TOOL_OP_SWEPT_2D@ : 24
TOOL_OP_SWEPT_3D@ : 25
TOOL_OP_COONS@ : 26
TOOL_OP_LOFTED@ : 27
TOOL_OP_5_AXIS_DRILLING@ : 28
TOOL_OP_5_AXIS_CURVE@ : 29
TOOL_OP_PROJECT_PLANE@ : 30
TOOL_OP_PROJECT_CYLINDER@ : 31
TOOL_OP_PROJECT_SPHERE@ : 32
TOOL_OP_PROJECT_CONE@ : 33
TOOL_OP_PROJECT_CROSS_SECTION@ : 34
TOOL_OP_PROJECT_SURFACE@ : 35
TOOL_OP_NON_ASSOCIATIVE_CONTOUR@ : 36
TOOL_OP_NON_ASSOCIATIVE_DRILLING@ : 37
TOOL_OP_NON_ASSOCIATIVE_POCKETING@ : 38
TOOL_OP_MULTISURF_FINISH_PENCIL_TRACE@ : 39
TOOL_OP_MULTISURF_FINISH_LEFTOVER_STOCK@ : 40
TOOL_OP_MULTISURF_FINISH_STEEP@ : 41
TOOL_OP_MULTISURF_FINISH_SHALLOW@ : 42
TOOL_OP_MULTISURF_FINISH_CONSTANT_SCALLOP@ : 43
TOOL_OP_MULTISURF_ROUGH_PLUNGE@ : 44
TOOL_OP_MULTISURF_FINISH_5AX_FLOWLINE@ : 45
TOOL_OP_MULTISURF_FINISH_4AX@ : 46
TOOL_OP_MERGED_ASCII_NCI@ : 47
TOOL_OP_5AX_SWARF@ : 48
TOOL_OP_5AX_ROLL_DIE@ : 49
TOOL_OP_THREAD_MILL@ : 100
TOOL_OP_EDIT_COMMON_OP_PARAMETERS@ : 101
TOOL_OP_FACING@ : 102
TOOL_OP_ASSOCIATIVE_TRIMMED@ : 103
TOOL_OP_SOLID_DRILL_CONTROL@ : 104
TOOL_OP_SLOT_MILL@ : 105
TOOL_OP_HELIX_BORE@ : 106
TOOL_OP_MULTISURF_ROUGH_RESTMILL@ : 107
TOOL_OP_ASSOCIATIVE_NESTING_CONTAINER@ : 108
TOOL_OP_MULTISURF_FINISH_BLEND@ : 109
TOOL_OP_MULTISURF_5AX_ROUGH@ : 110
TOOL_OP_SLICE_5AX@ : 111
TOOL_OP_PORT_5AX@ : 112
TOOL_OP_5AX_CIRCLE@ : 113
TOOL_OP_TAB_CUTOFF@ : 130
TOOL_OP_MULTISURF_ROUGH_POCKET_LIGHT@ : 131
TOOL_OP_HIGH_SPEED_SURFACE@ : 132
TOOL_OP_NESTING_ONIONSKIN@ : 133
TOOL_OP_2D_HARDMILL_MACHINING_PEEL_MILL@ : 134
TOOL_OP_SAW@ : 135
TOOL_OP_FBM_DRILL_CONTROL@ : 136
TOOL_OP_FBM_MILL_POCKET@ : 137
TOOL_OP_FBM_MILL_CONTOUR@ : 138
TOOL_OP_SOLID_MODEL@ : 139
TOOL_OP_PROBE_CYCLE_PROBE_MOTION@ : 150
TOOL_OP_PROBE_CYCLE_COMMAND_BLOCK@ : 151
TOOL_OP_PROBE_CYCLE_HEADER@ : 152
TOOL_OP_PROBE_CYCLE_TRAILER@ : 153
TOOL_OP_LINKING@ : 154
TOOL_OP_DRILL5AX_SAFETYZONE@ : 155
TOOL_OP_BLOCK_DRILL@ : 306
TOOL_OP_ENGRAVING@ : 416
TOOL_OP_ART@ : 439
TOOL_OP_ADV_MULTIAX_SWARF@ : 441
TOOL_OP_ADV_MULTIAX_MORPH@ : 442
TOOL_OP_ADV_MULTIAX_PARALLEL@ : 443
TOOL_OP_ADV_MULTIAX_ALONG_CURVE@ : 444
TOOL_OP_ADV_MULTIAX_TRIANGULAR_MESH@ : 445
TOOL_OP_ADV_MULTIAX_ROUGHING@ : 446
TOOL_OP_ADV_MULTIAX_PROJECT@ : 447
TOOL_OP_CONVERT_TO_5AX@ : 448
TOOL_OP_PORT_EXPERT@ : 449
TOOL_OP_BLADE_EXPERT@ : 450
TOOL_OP_ROTARY_ADVANCED@ : 451
TOOL_OP_5AX_SURF_FLOWLINE@ : 452
TOOL_OP_5AX_CONVERT_AUTOTILT@ : 453
TOOL_OP_5AX_CONVERT_WRAP@ : 454
TOOL_OP_5AX_CONVERT_DROP@ : 455
TOOL_OP_5AX_CONVERT_LINK@ : 456
TOOL_OP_5AX_DRILLING@ : 457
TOOL_OP_5AX_WIREFRAME@ : 458
TOOL_OP_5AX_DEBURR@ : 459
#endregion
Mastercam后处理坐标偏移方法



4:定义钻孔类型集合

#region Globals for multicheck
drilling_op =
      (
       tt_tool_op$ = TOOL_OP_DRILL@ |
      tt_tool_op$ = TOOL_OP_5_AXIS_DRILLING@ |
      tt_tool_op$ = TOOL_OP_NON_ASSOCIATIVE_DRILLING@ |
       tt_tool_op$ = TOOL_OP_SOLID_DRILL_CONTROL@ |
      tt_tool_op$ = TOOL_OP_FBM_MILL_CONTOUR@ |
      tt_tool_op$ = TOOL_OP_BLOCK_DRILL@
      )




5:定义高速策略

op_uses_model_geometry =
      (
      tt_tool_op$ = TOOL_OP_HIGH_SPEED_SURFACE@
      )


6:定义数据格式,前缀等。

fmt "WALL STOCK: "3wall_stock#Stock info note format
fmt "FLOOR STOCK: " 3floor_stock #Stock info note format
fmt "WALL STOCK MIN: "    3min_wall_stock", " #Stock info note format
fmt "WALL STOCK MAX: "    3max_wall_stock","   #Stock info note format
fmt "FLOOR STOCK MIN: "   3min_floor_stock ", " #Stock info note format
fmt "FLOOR STOCK MAX: "   3max_floor_stock ","#Stock info note format


7:定义输出的策略


pstock_leave
      if not(drilling_op) & oneZone_stock_to_leave, pget_stock_to_leave



8:获取预留量主要过程。

pget_stock_to_leave
      wall_stock = zero
      floor_stock = zero
      max_wall_stock = LOW@
      min_wall_stock = HIGH@
      max_floor_stock = LOW@
      min_floor_stock = HIGH@

      if op_uses_model_geometry,
      [
      stock_index = zero
      sstock = stockinfo(zero, op_id$, stock_index)
      while sstock <> sblank,
          [
          wall_stock = rparsngl(sstock, WALL_STOCK@)
          floor_stock = rparsngl(sstock, FLOOR_STOCK@)
          geo_group = stock_index + one
         if wall_stock <>0 | floor_stock <>0,
            [
             "(",*geo_group, , , ")", e$
            ]
          stock_index = stock_index + one
          sstock = stockinfo(zero, op_id$, stock_index)
          ]
      ]
      else,
      [
      wall_stock = opinfo(10010, zero)
      floor_stock = opinfo(10068, zero)
      if wall_stock <> INVALID_QUERY@ & floor_stock <> INVALID_QUERY@,
          [
          if wall_stock <>0 | floor_stock <>0,
            [
             "(",, , ")", e$
            e$
            ]
          ]
      ]




9:在需要输出的位置调用即可

pstock_leave




不是很完美 但还能用 可以借鉴一下

疯狂的铣叨 发表于 2024-10-24 10:18:34

输出结果 仅供参考
页: 1 [2] 3 4 5
查看完整版本: 求大神给帮忙改下后处理