- 积分
- 13648
- 明经币
- 个
- 注册时间
- 2016-1-18
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2016-5-10 13:09:00
|
显示全部楼层
;;;;;;;;;;;;;;;;;;;;;;; KozMos AnnoQuarX Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Name: AQX:GETMTEXTBOX(2) ;;;
;;; Descryption: Get the boundary rectangle box of the MTEXT/TEXT ;;;
;;; Argu(1): The annotation object selectionset ENAME ;;;
;;; Argu(2): Offset distance, nil for 0.0 REAL ;;;
;;; ------------------------------------------------------------------------------------------- ;;;
;;; RetValue(OK) 4-Points-list (LL, LR, UR, UL) LIST ;;;
;;; RetValue(FAIL) NIL BOOLEAN ;;;
;;; ------------------------------------------------------------------------------------------- ;;;
;;; Example (AQX:GETMTEXTBOX (car(entsel)) 0.0) ;;;
;;; ====> ((97346.9 291.883) (61132.6 20869.7) (56983.4 13567.6) (93197.6 -7010.23));
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2014/11/28 (Koz Jono Yeoh) ;;;;;;;;
(Defun AQX:GETMTEXTBOX (obj off / MXV B ENX H J L M N O P R W)
(Defun mxv (m v)
(mapcar '(lambda (r) (apply '+ (mapcar '* r v))) m)
)
(setq enx (entget obj))
(if (null off)
(setq off 0.0)
)
(if
(setq l
(cond
((= "TEXT" (cdr (assoc 0 enx)))
(setq b (cdr (assoc 10 enx))
r (cdr (assoc 50 enx))
l (textbox enx)
)
(list
(list (- (caar l) off) (- (cadar l) off))
(list (+ (caadr l) off) (- (cadar l) off))
(list (+ (caadr l) off) (+ (cadadr l) off))
(list (- (caar l) off) (+ (cadadr l) off))
)
)
((= "MTEXT" (cdr (assoc 0 enx)))
(setq n (cdr (assoc 210 enx))
b (trans (cdr (assoc 10 enx)) 0 n)
r (angle '(0.0 0.0 0.0) (trans (cdr (assoc 11 enx)) 0 n))
w (cdr (assoc 42 enx))
h (cdr (assoc 43 enx))
j (cdr (assoc 71 enx))
o (list
(cond
((member j '(2 5 8)) (/ w -2.0))
((member j '(3 6 9)) (- w))
(0.0)
)
(cond
((member j '(1 2 3)) (- h))
((member j '(4 5 6)) (/ h -2.0))
(0.0)
)
)
)
(list
(list (- (car o) off) (- (cadr o) off))
(list (+ (car o) w off) (- (cadr o) off))
(list (+ (car o) w off) (+ (cadr o) h off))
(list (- (car o) off) (+ (cadr o) h off))
)
)
)
)
((lambda (m)
(mapcar '(lambda (p) (mapcar '+ (mxv m p) b)) l)
)
(list
(list (cos r) (sin (- r)) 0.0)
(list (sin r) (cos r) 0.0)
'(0.0 0.0 1.0)
)
)
)
) |
评分
-
查看全部评分
|