QQ登录

只需一步,快速开始

登录 | 注册 | 找回密码

三维网

 找回密码
 注册

QQ登录

只需一步,快速开始

展开

通知     

全站
1天前
查看: 1805|回复: 6
收起左侧

[求助] 二次开发时如何获取每个刀具路径的总加工时间

[复制链接]
回帖奖励 8 点三维币 回复本帖可获得 1 点三维币奖励! 每人限 1 次
发表于 2019-1-17 17:42:04 | 显示全部楼层 |阅读模式 来自: 中国浙江台州

马上注册,结识高手,享用更多资源,轻松玩转三维网社区。

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

x
本帖最后由 jiangxuefei 于 2019-1-17 22:07 编辑
( O2 s9 v0 y" F! l3 D1 x; Y( ~2 L% D! M# W9 n0 L( K9 v0 N
开发环境:POWERMILL2017 + VS2013 C# + PowerShape and PowerMill API 2017 R3* w& N+ b1 ]$ I$ n5 n6 r
# y  K) c  Y+ c. A" c
从AUTODESK论坛上看到下面的代码。试过也是可以的。但是我感觉应该POWERMILL有什么没有公开的命令。
8 T# _* T: ?" V- G0 B7 g
  1. : L- V9 d" }" H6 M' h3 R/ j" j
  2. var rapid = double.Parse((string)powerMill.ExecuteEx($"print par terse "entity('toolpath', '{ToolPath.Name}').Statistics.LeadsandLinks.Times.Rapid""));
    & D0 V6 [, Y/ d0 J% F) ]
  3. 2 [( G  c' V1 u& P5 @$ d
  4. var plunge = double.Parse((string)powerMill.ExecuteEx($"print par terse "entity('toolpath', '{ToolPath.Name}').Statistics.LeadsandLinks.Times.Plunge""));% N1 |6 k4 O( p3 \+ ~4 K6 {
  5.   w0 i* [% ^2 N' j2 I
  6. var ramp = double.Parse((string)powerMill.ExecuteEx($"print par terse "entity('toolpath', '{ToolPath.Name}').Statistics.LeadsandLinks.Times.Ramp""));
    9 t! `, a3 K) U5 \4 s9 r3 s' s1 |

  7. ( @1 |3 p0 j$ }! O, d
  8. var others = double.Parse((string)powerMill.ExecuteEx($"print par terse "entity('toolpath', '{ToolPath.Name}').Statistics.LeadsandLinks.Times.Others""));4 [' l) d( c* K) B/ Y% a

  9. / C) N/ L' r$ u5 {1 P* Q: l3 h9 Y2 W
  10. var linear = double.Parse((string)powerMill.ExecuteEx($"print par terse "entity('toolpath', '{ToolPath.Name}').Statistics.CuttingMoves.Times.Linear""));
    " g0 X6 N7 `) r+ X- ]

  11. . N8 d7 T& y) Q0 N, m, }
  12. var arcs = double.Parse((string)powerMill.ExecuteEx($"print par terse "entity('toolpath', '{ToolPath.Name}').Statistics.CuttingMoves.Times.Arcs""));" o& O- X! M# V6 c3 d$ V' ]! }/ I
  13. 7 A/ j, o2 ~9 K# N
  14. var total = rapid + plunge + ramp + others + linear + arcs;" T8 Y2 O8 F: _4 P7 W% J3 e
  15. + T+ s' s! ^/ t7 h" P9 z
  16. TotalTime = TimeSpan.FromMinutes(total);
复制代码
$ t* t9 U5 K! W( Q+ G; J+ s" Y, L

  A/ D6 z2 c+ p. [* G  E  [/ N
快照6.png
 楼主| 发表于 2019-1-18 17:45:15 | 显示全部楼层 来自: 中国浙江台州
似乎从AUTODESK网站也是这么一个思路阿。: v! B" W- y0 L) ~

- w  ~+ Z, t5 S% U- y; _1 n, A原贴地址:https://github.com/Autodesk/Powe ... asses/PMToolpath.cs8 m- u, F" z) d& ~
快照6.png
 楼主| 发表于 2019-1-19 00:36:18 | 显示全部楼层 来自: 中国浙江台州
在POWERMILL2016中原来可以这样操作。看下图。
9 F# z# |0 A- t4 t. {1 D; e0 X
获取某一个激活的刀具路径的理论时间.png
 楼主| 发表于 2019-1-19 00:51:34 | 显示全部楼层 来自: 中国浙江台州
很奇怪,为什么都没有人回复呢。
 楼主| 发表于 2019-1-19 01:08:31 | 显示全部楼层 来自: 中国浙江台州
欢迎有自学二次开发的志同道合的朋友一起学习。
发表于 2019-5-10 15:20:39 | 显示全部楼层 来自: 中国浙江宁波

回帖奖励 +1 点三维币

谢谢分享,十分感谢,3Q
发表于 2019-7-31 23:02:24 | 显示全部楼层 来自: 中国浙江

回帖奖励 +1 点三维币

good look
发表回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则


Licensed Copyright © 2016-2020 http://www.3dportal.cn/ All Rights Reserved 京 ICP备13008828号

小黑屋|手机版|Archiver|三维网 ( 京ICP备2023026364号-1 )

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