写了一个,可能不合要求。- ;标记图框 明经 ZZXXQQ 2014.3.8
- (defun c:tt ()
- (setvar "CMDECHO" 0)
- (vl-load-com)
- (if (setq ss (ssget '((0 . "LWPOLYLINE") (8 . "SS-TITLE") (90 . 4) (70 . 1) (40 . 0.0)))) (progn
- (setq i -1)
- (repeat (sslength ss)
- (setq en (ssname ss (setq i (1+ i))))
- (vla-getboundingbox(vlax-ename->vla-object en) 'p1 'p2)
- (setq p1 (vlax-safearray->list p1)
- p2 (vlax-safearray->list p2))
- (setq ss2 (ssget "W" p1 p2 '((0 . "INSERT") (2 . "$$titleblk$$00000109"))))
- (setq scl (cdr(assoc 41 (entget(ssname ss2 0)))))
- (setq h (/ (- (cadr p2) (cadr p1)) scl))
- (setq w (/ (- (car p2) (car p1)) scl))
- (cond
- ((equal h 841 1) (setq A "A0"))
- ((equal h 594 1) (setq A "A1"))
- ((equal h 420 1) (setq A "A2"))
- ((and (equal h 297 1) (>= w 419)) (setq A "A3"))
- ((and (equal h 297 1) (>= w 209)) (setq A "A4"))
- ((and (equal h 210 1) (>= w 296)) (setq A "A4"))
- )
- (setq A (strcat a "(" (rtos h 2 0) "x" (rtos w 2 0) ")-1:" (rtos scl 2 0)))
- (setq pt1 (polar (polar p1 (/ pi 2) (+ (* h scl) 2000)) 0 2000))
- (setq pt2 (polar (polar p2 (/ pi 2) 2000) pi 2000))
- (entmake
- (list '(0 . "TEXT") (cons 10 pt1) '(8 . "DEFPOINTS") '(62 . 1)
- '(50 . 0.0) '(41 . 0.85) '(40 . 5000.0) (cons 1 A) '(7 . "W-黑体"))
- )
- (entmake
- (list '(0 . "TEXT") '(10 0.0 0.0 0.0) '(8 . "DEFPOINTS") '(62 . 3) '(50 . 0.0) '(41 . 0.85)
- '(40 . 5000.0) (cons 1 (itoa (1+ i))) '(7 . "W-黑体") '(72 . 2) (cons 11 pt2))
- )
- )
- ))
- (setvar "CMDECHO" 0)
- (princ)
- )
|