明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1366|回复: 2

ENTSEL问题请教

[复制链接]
发表于 2009-1-31 15:46:00 | 显示全部楼层 |阅读模式

用ENTSEL点击在一根线上,怎么求出当前点的坐标在这根线的哪两个端点之间,请教一下,小弟有礼了,

发表于 2009-1-31 21:38:00 | 显示全部楼层
  1. (if (and
  2.       (setq sel (entsel "\nSelect pline: "))
  3.       (setq ent (car sel))
  4.       (= (cdr (assoc 0 (entget ent))) "LWPOLYLINE")
  5.     )
  6.   (setq pt (vlax-curve-getclosestpointto ent (cadr sel))
  7. param1 (fix (vlax-curve-getparamatpoint ent pt))
  8. param2 (1+ param1)
  9. startpt (vlax-curve-getpointatparam ent param1)
  10. endpt (vlax-curve-getpointatparam ent param2)
  11.   ;; bulge1 (vla-getbulge (vlax-ename- )
  12.          ;;do whatever with the data
  13.   )
  14. )
ref link: http://www.rafal.waw.pl/cad/get-segment-data-selected-lwpolyline-out-exploding.html

 楼主| 发表于 2009-2-1 13:25:00 | 显示全部楼层
谢谢了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-28 16:21 , Processed in 0.168219 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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