想达到的目的:选取N多个圆、圆弧、椭圆和椭圆弧移动到指定点(最终必须是N多个圆同一个圆心点), 省去一个个操作的麻烦
;;;圆、圆弧移动到指定点(同一个圆心点) (defun c:QQ ()(setvar "pickbox" 24)(setvar "cmdecho" 0) (setvar "CMDECHO" 0) (STRCAT "请选取要移动的圆、圆弧、椭圆和椭圆弧 :") (setq ss (ssget '((0 . "Arc,Circle,Ellipse")))) (= (sslength ss) 2)) (progn (setq en (ssname ss 0) ent (entget en)) (if (= (cdr(assoc 0 ent)) '((0 . "Arc,Circle,Ellipse"))) (setq en1 (ssname ss 1) ent1 (entget en1)) (setq en1 en ent1 ent en (ssname ss 1) ent (entget en)) ) (setq pc (cdr(assoc 10 ent1)) ptt (txtcen ent)) (setq pc (cdr (assoc 10 ent)))) (setq pt2 (getpoint "[选择目标点] : ")) (command ".move" en "" ptt pc) )) (setq SS nil) (setvar "cmdecho" 1)) |