- 积分
- 10154
- 明经币
- 个
- 注册时间
- 2012-4-10
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
忘记是那位仁兄发的代码了。用了一下只能实现图中中间样子,那位能帮忙修改一下能施现第三个样式。谢谢
;;;修剪曲线距最近交点点取边
;;;功能: 以曲线与其它曲线最进交点为判断点,修剪曲线点取处的一边.
(defun c:zqxj (/ A BOX D11 D12 D21 D22 E EE EE2 LL P RR SS nm nm2)
(vl-load-com)
(while
(and
(setq a (entsel))
(setq e (car a)
nm (vla-get-objectname (vlax-ename->vla-object e))
)
(setq p (vlax-curve-getclosestpointto e (cadr a)))
)
(setq ee (entlast))
(if (member nm '("AcDbRay" "AcDbXline"))
(setq box (mapcar 'getvar '("vsmin" "vsmax")))
(progn (vla-GetBoundingBox (vlax-ename->vla-object e) 'll 'rr)
(setq box (list (vlax-safearray->list ll)(vlax-safearray->list rr))
)
)
)
(setq ss (ssget "c" (car box) (cadr box) '((0 . "*LINE,ARC,RAY,CIRCLE,ELLIPSE"))))
(command ".trim" ss "r" e "" "e" "n" (list e p) "");!!!
(if (equal ee (setq ee2 (entlast)))
nil
(progn
(setq nm2 (vla-get-objectname (vlax-ename->vla-object ee2))
d11 (distance p (vlax-curve-getstartpoint e))
d12 (if (= nm2 "AcDbRay")1e99(distance p (vlax-curve-getendpoint e)))
d21 (distance p (vlax-curve-getstartpoint ee2))
d22 (if (= nm2 "AcDbRay") 1e99(distance p (vlax-curve-getendpoint ee2)))
)
(if (member (min d11 d12 d21 d22) (list d11 d12))
(entdel ee2)
(entdel e)
)
)
)
)
(princ)
)
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|