立即注册 登录
晓东CAD家园-论坛 返回首页

eachy的个人空间 http://bbs.xdcad.net/?14 [收藏] [复制] [分享] [RSS]

日志

任意指定LightweightPolyline的起点位置

已有 211 次阅读2013-5-6 18:02 |个人分类:Lisp

程序写的比较简单,还可以增加在起点处显示“叉”就更明显了

;;reset startpoint of lightweightpolyline
(defun c:tt (/ e p el el1 pam pam0 pam1 pam2 el2 el3)
(if (and (setq e (entsel "\nSelect LightweightPolyline: "))
(setq p (getpoint "\nPick Startpoint to: "))
)
(progn
(setq el (entget (car e));_ dxf list
el1 (vl-remove-if-not
'(lambda (x) (vl-position (car x) '(10 40 41 42)))
(member (assoc 10 el) el)
);_property of coordinate (point startwidth endwidth bulge ...)
el2 (reverse (cdr (member (assoc 10 el) (reverse el))));_lwpolyline dxf header
pam (vlax-curve-getparamatpoint
(car e)
(vlax-curve-getclosestpointto (car e) p)
);_ get index of pline
pam1 (fix pam);_ previous index
pam2 (1+ pam1);_ next index
)
(if (>= (- pam pam1) 0.5)
(setq pam0 pam2)
(setq pam0 pam1)
);_ near index
(setq p (nth (* 4 pam0) el1));_ A set of four
(setq el3 (append (member p el1)
(reverse (cdr (member p (reverse el1))))
)
);_ reset points
(entmod (append el2 el3))
)
)
(princ)
)

路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 立即注册

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-5-14 00:21 , Processed in 0.124236 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

返回顶部