(defun c:sw (/ word ss n k en en_data en_type k z xy x y 10_data pt1 new_10_data 11_data pt2 38_data h new_38_data 12_data pt5 new_12_data 15_data pt6 new_15_data 16_data pt7 new_16_data 13_data pt3 new_13_data 14_data pt4 new_14_data n no key ) (initget "y n") (setq word (getkword "\n是否将物体放在0平面上<n> <y>:")) (if (null word) (setq word "y") ) (cond ((= word "y") (foun)) ((= word "Y") (foun)) ((= word "N") (nil)) ((= word "n") (nil)) ) ) (defun foun () (setq ss (ssget "x" )) (setq n (sslength ss)) (setq k 0) (repeat n (setq en (ssname ss k)) (setq en_data (entget en)) (setq en_type (cdr (assoc 0 en_data))) (cond ((= en_type "LINE") (line)) ((= en_type "LWPOLYLINE") (lwpolyline)) ((= en_type "CIRCLE") (circle)) ((= en_type "ARC") (circle)) ((= en_type "DIMENSION") (dimension)) ((= en_type "MTEXT") (line)) ((= en_type "TEXT") (line)) ((= en_type "ATTDEF") (line)) ((= en_type "ELLIPSE") (line)) ((= en_type "HATCH") (circle)) ((= en_type "SOLID") (solid)) ((= en_type "INSERT") (circle)) ((= en_type "POINT") (circle)) ((= en_type "XLINE") (line)) ((= en_type "LEADER") (leader)) ) (entmod en_data) (setq k (1+ k)) |