单选如何修改成框选?
(defun c:tt ()(if (and (setq s1 (car (entsel "\n选择: ")))
(xyp-Etype s1 "insert")
)
(foreach a (xyp-Block-OnameList (vlax-ename->vla-object s1))
(cond ((xyp-Etype (vlax-vla-object->ename a) "line")
(vla-put-color a 1)
)
((xyp-Etype (vlax-vla-object->ename a) "*text")
(vla-put-color a 3)
)
)
)
)
(command "REGEN" )
(princ)
)
(defun c:tt ()
(if (setq ssa (ssget '((0 . "insert")))) ;可单选、多选、框选
(progn
(setq i 0)
(setq n (sslength ssa))
(repeat n
(setq s1 (ssname ssa i))
(foreach a (xyp-Block-OnameList (vlax-ename->vla-object s1))
(cond ((xyp-Etype (vlax-vla-object->ename a) "line")
(vla-put-color a 1)
)
((xyp-Etype (vlax-vla-object->ename a) "*text")
(vla-put-color a 3)
)
)
)
(setq i (1+ i))
)
(command "REGEN" )
)
)
(princ)
)
页:
[1]