标注合并;; (defun c:21( / d13 d14 dxf dxfn e1 e2 n p13 p14 plst ss) (command "ucs" "w") (setvar "cmdecho" 0) (princ "\n选择标注尺寸...") (setq ss (ssget '((0 . "DIMENSION")))) (setq n -1 plst '()) (repeat (sslength ss) (setq dxf (entget (ssname ss (setq n (1+ n))))) (setq d13 (cdr (assoc 13 dxf)) d14 (cdr (assoc 14 dxf))) (setq plst (cons d13 (cons d14 plst))) ) (setq plst (vl-sort plst (function (lambda (e1 e2) (< (car e1) (car e2)))))) (setq plst (vl-sort plst (function (lambda (e1 e2) (< (cadr e1) (cadr e2)))))) (setq p13 (car plst) p14 (last plst)) (setq dxfn (subst (cons 13 p13) (assoc 13 dxf) dxf) dxfn (subst (cons 14 p14) (assoc 14 dxfn) dxfn)) (entmake dxfn) (command ".erase" ss "") (command "ucs" "p") (princ) ) |