(defun c:test( / x y ss i pt) (setq X 10) (setq Y 5) (setq ss (ssget "x" (list '(0 . "circle") (cons 40 (/ X 2))))) (setq i 0) (repeat (sslength ss) (setq pt (cdr (assoc 10 (entget (ssname ss i))))) (command "_.circle" pt (/ Y 2)) (setq i (1+ i)) ) (princ) )
(defun c:test( / x y ss i pt) (setq X (getreal "输入X:")) (setq Y (getreal "输入Y:")) (setq ss (ssget (list '(0 . "circle") (cons 40 (/ X 2))))) (setq i 0) (repeat (sslength ss) (setq pt (cdr (assoc 10 (entget (ssname ss i))))) (command "_.circle" pt (/ Y 2)) (setq i (1+ i)) ) (princ) )
但是你是如何实现窗选对象呢?
下面这段程序无法窗选对象,看不出差别!
(defun c:test( / x y ss i pt) (setq x (GETREAL "输入直径x: ")) (setq y (GETREAL "输入直径y: ")) (setq ss (ssget "x" (list '(0 . "circle") (cons 40 (/ X 2))))) (setq i 0) (repeat (sslength ss) (setq pt (cdr (assoc 10 (entget (ssname ss i))))) (command "_.circle" pt (/ Y 2)) (setq i (1+ i)) ) (princ) )