CAD中怎么把一条直线从交点处断成两条?
2个回答
2016-03-13 · 知道合伙人软件行家
关注
展开全部
打断与点的话,可以考虑使用autolisp来解决,代码如下:
;;打断曲线与点;;;
(defun c:dx ( / &k1 &ob1 pt1 pt2);打断与点
(setvar "cmdecho" 0)
(setvar "blipmode" 0)
(if (null vlax-dump-object) (vl-load-com) )
(while (and
(setq &k1 (entsel "\n请选择要打断的不封闭对象"))
(setq &k1 (car &k1))
(member (cdr (assoc 0 (entget &k1))) '("ARC" "LINE" "LWPOLYLINE" "ELLIPSE" "SPLINE"))
(= (vlax-curve-isClosed (setq &ob1 (vlax-ename->vla-object &k1))) nil)
(setq pt2 (getpoint "\n请选择打断的点"))
(setq pt1 (vlax-curve-getclosestpointto &ob1 pt2))
(<= (distance pt1 pt2) 39)
)
;(vla-put-color &ob1 256)
(command "BREAK" (list &k1 pt1) pt1)
)
(princ)
);复制到记事本,以【.lsp】为后缀命名,autolisp加载了,命令【DX】,就可以打断与点了。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询