(setq entde (ssadd))
(setq s (ssget "X" '((0 . "line,arc,circle,POLYLINE,LWPOLYLINE,SPLINE"))))
(setq n (sslength s))
(setq index (- n 1))
(repeat n
(vl-load-com)
(setq ent (ssname s index))
(setq curve-obj (vlax-ename->vla-object ent))
(setq leng (vlax-curve-getDistAtParam
curve-obj
(vlax-curve-getEndParam curve-obj)
)
)
(setq index (- index 1))
(if (> leng 0.005)
T
(progn
(setq entde (ssadd ent entde))
)
)
)
(command "_.ERASE" entde "")
(princ)
)
;批量删除短小线的插件
(defun c:e3 (/ s n index ent leng)
(setvar "cmdecho" 0)(command "UNDO" "G")
(if (not va) (progn (setq va 0.3)) (setq va2 va))
(setq va2 (getreal (strcat "\n請輸入欲删除線长在<0.3>以下之圖元<" (rtos va) ">:")))
(if (not va2) (setq va2 va) (setq va va2))
(setq entde (ssadd))
(setq s (ssget '((0 . "line,arc,circle,POLYLINE,LWPOLYLINE,SPLINE"))))
(setq n (sslength s))
(setq index (- n 1))
(repeat n
(vl-load-com)
(setq ent (ssname s index))
(setq curve-obj (vlax-ename->vla-object ent))
(setq leng (vlax-curve-getDistAtParam
curve-obj
(vlax-curve-getEndParam curve-obj)
)
)
(setq index (- index 1))
(if (> leng va2)
T
(progn
(setq entde (ssadd ent entde))
)
)
);(prompt (strcat "\r余 " (itoa (- SSL N)) " 个物件 "))
(command "_.ERASE" entde "")
(setq mm (sslength entde))
;(prompt (strcat "\共删除长度" (itoa (VA2)) "以下图元" (itoa (entde)) " 个 "))
(princ "\n共删除长度")
(princva2)
(princ "以下图元")
(princ mm)
(princ"个")
(command "UNDO" "E")
(princ)
)
2496653555 发表于 2021-4-21 10:40
;批量删除短小线的插件
(defun c:e3 (/ s n index ent leng)
(setvar "cmdecho" 0)(command "UNDO" "G" ...
上面的改了一下,加了输入长度,最后的提示请大神帮忙改下, 源码看不懂,能否直接发插件 shyshineboy 发表于 2012-10-31 10:26
用cad自带的qs命令选择后 e删除
qs不是保存命令吗
页:
1
[2]