明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1618|回复: 1

[求助]统计交点数

[复制链接]
发表于 2009-9-7 14:42:00 | 显示全部楼层 |阅读模式
请问高手,CAD中有很多时候要统计交点数,如统计孔数……怎样实现。谢谢!
发表于 2009-9-7 15:34:00 | 显示全部楼层

两曲线的交点,可由intersectwith方法得到,但不只何故有交点漏掉。

(defun lf_entinters (e1 e2 k / lst lst2)
   (setq lst (vlax-invoke
  (vlax-ename->vla-object e1)
  'intersectwith
  (vlax-ename->vla-object e2)
  k
      )
   )
   (IF lst
      (repeat (/ (length lst) 3)
  (setq lst2 (cons (list (car lst) (cadr lst) (caddr lst)) lst2)
        lst  (cdddr lst)
  )
      )
   )
   (reverse lst2)
)


;;k的取值
;;acExtendNone : 0, Does not extend either object.
;;acExtendThisEntity : 1, Extends the base object.
;;acExtendOtherEntity : 2, Extends the object passed as an argument.
;;acExtendBoth : 3,Extends both objects

(defun c:ttt ()
   (lf_entinters (car (entsel))(car (entsel)) 0)
)  
 

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

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-10-1 12:19 , Processed in 0.157982 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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