求实现这个功能的工具
本帖最后由 qq25469005 于 2023-2-22 16:21 编辑;请试用以下程序
(defun c:brs (/ cmd osm dist dis1 ent en1 ptt pt0 pt1 pt2 zcd dqL name)
(vl-load-com)
(setq cmd (getvar "cmdecho"))
(setq osm (getvar "osmode"))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(vl-cmdf "_undo" "be")
(If (= (setq dis1 (getreal "\n输入打断间距<0.8>:")) nil)
(setq dis1 0.8)
)
(setq dist (* 0.5 dis1))
(while (setq en1 (entsel "\n选择要打断的线:"))
(setq ptt (cadr en1))
(setq ent (car en1))
(setq name (cdr (assoc 0 (entget ent))))
(if (wcmatch name "LINE,*POLYLINE,SPLINE,ARC,CIRCLE,ELLIPSE")
(progn
(setq pt0 (vlax-curve-getClosestPointTo ent ptt))
(setq zcd (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent)))
(setq dqL (vlax-curve-getdistatpoint ent pt0))
(if (<= dist dqL (- zcd dist))
(progn
(setq pt1 (vlax-curve-getpointatdist ent (- dqL dist)))
(setq pt2 (vlax-curve-getpointatdist ent (+ dqL dist)))
(vl-cmdf "_break" ent "f" pt1 pt2)
)
)
)
(alert "你选取的不是直线、多段线、样条曲线、圆、椭圆、圆弧、椭圆弧中一种,请重新选取!")
)
)
(vl-cmdf "_undo" "e")
(setvar "osmode" osm)
(setvar "cmdecho" cmd)
(princ)
) 本帖最后由 1291500406 于 2019-3-29 22:17 编辑
(defun c:bb ()(setvar "cmdecho" 0)(setq a(getreal "\n必强提示:指定断口大小"))(if a(progn(while(setq b(getpoint "\n必强提示:指定位置"))(command "circle" b "d" a)(setq ss (entlast))(command "_trim" ss "" (entsel "\n必强提示:选择剪切对象:") pause )(command "erase" ss ""))))(princ)) 本帖最后由 qq25469005 于 2019-4-17 08:43 编辑
1291500406 发表于 2019-3-29 16:36
(defun c:bb ()(setvar "cmdecho" 0)(setq a(getreal "\n必强提示:指定断口大小"))(if a(progn(while(setq...
(defun c:BRS (/ en1 len1 pt0)
(vl-load-com)
(setq dis1 (getreal "\n输入打断间距:"))
)有时候断口距离不标准,能帮我优化下吗 yshf 发表于 2019-3-27 12:37
;请试用以下程序
(defun c:brs (/ cmd osm dist dis1 ent en1 ptt pt0 pt1 pt2 zcd dqL name)
(vl-l ...
你好,为什么在CAD2019里面显示点为空,cad2007正常 是pt0?
还是pt1?
或是pt2?
请上传出问题的测试图 yshf 发表于 2019-5-27 15:09
是pt0?
还是pt1?
或是pt2?
选择的时候只有亮显,点无效,应该是pt0
厉害,,路过,顶起
页:
[1]