请高手帮忙修改程序:能否改成选定多段线或圆内的图形进行删除或移动或复制
本帖最后由 zhouzhiy 于 2018-6-8 20:21 编辑(defun C:WPS ( / i elist at cmde cen rad p1)
(setq cmde (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq i 0 elist (entget (car (entsel "\nPick a circle or polyline: "))))
(setvar "OSMODE" (boole 7 (getvar "OSMODE") 16384))
(if (zerop (getvar "CMDACTIVE")) (command "_select"))
(command "_wp") ; or _CP
(if (= (cdr(assoc 0 elist)) "CIRCLE")
(progn
(setq cen (cdr (assoc 10 elist))
rad (cdr (assoc 40 elist))
)
(repeat 90 ; 360/40.06981317=4*pi/180
(setq p1 (polar cen (* i 0.06981317) rad)i (1+ i))
; (command "_POINT" (trans p1 0 1))
(command (trans p1 0 1))
)); else
(repeat (length elist)
(setq at (nth i elist) i (1+ i))
; (if (= (car at) 10) (command (cdr at)))
(if (= (car at) 10) (command (trans (cdr at) 0 1)))
)
);if CIRCLE
(command "")
(setvar "OSMODE" (boole 2 (getvar "OSMODE") 16384))
(setvar "cmdecho" cmde)
(princ)
)
Command: wps
Pick a circle or polyline:
Select objects:
Command: m
MOVE
Select objects: p 你好!能完整的lap上传吗? 您可能会与程序互动的的架构!?
如何运作较有效率,请举实例 举例文件,将蓝色范围多段线内的点、数字、图形等进行删除或移动或复制。此图举例多段线里为点和数字,如果要有其它图形也一样
一次性选择一条或无数条多段线或圆 Command: wps
Pick a circle or polyline:
Select objects:选了右下的 LwPolyline
Command: e
ERASE
Select objects: p
746 found
Select objects:
如上执行
您的想法又是如何!?
CAD小帮手技术交流群1: 115604002(视频和原图档请在群文件下载)
CAD小帮手技术交流群2: 618984401(视频和原图档请在群文件下载)
本帖最后由 yfanzi 于 2018-10-4 18:04 编辑
同求,请大神关注!!!论坛找了个圆内选择的!求矩形或者多边形选择的!
页:
[1]