马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 ayl1004 于 2013-6-8 10:38 编辑
 - (defun GetMTextEdgeBox (Ename / EnLst InsPt Align Width
- Heigh MinPt MaxPt Rotat Angl0 Angl1
- )
- (and
- (setq EnLst (entget Ename))
- (= (cdr (assoc 0 EnLst)) "MTEXT")
- (progn
- (setq InsPt (cdr (assoc 10 EnLst))
- Align (cdr (assoc 71 EnLst))
- Width (cdr (assoc 42 EnLst))
- Heigh (cdr (assoc 43 EnLst))
- Rotat (cdr (assoc 50 EnLst))
- Angl0 (+ (* pi 1.5) Rotat)
- Angl1 (+ pi Rotat)
- )
- (cond
- ((= Align 1)
- (setq MinPt (polar InsPt Angl0 Heigh)
- MaxPt (polar InsPt Rotat Width)
- )
- )
- ((= Align 4)
- (setq MinPt (polar InsPt Angl0 (* Heigh 0.5))
- MaxPt (polar InsPt (+ Angl0 pi) (* Heigh 0.5))
- MaxPt (polar MaxPt Rotat Width)
- )
- )
- ((= Align 7)
- (setq MinPt InsPt
- MaxPt (polar InsPt (+ Angl0 pi) Heigh)
- MaxPt (polar MaxPt Rotat Width)
- )
- )
- ((= Align 2)
- (setq MinPt (polar InsPt Angl0 Heigh)
- MinPt (polar MinPt Angl1 (* Width 0.5))
- MaxPt (polar InsPt Rotat (* Width 0.5))
- )
- )
- ((= Align 5)
- (setq MinPt (polar InsPt Angl0 (* Heigh 0.5))
- MinPt (polar MinPt Angl1 (* Width 0.5))
- MaxPt (polar InsPt (+ Angl0 pi) (* Heigh 0.5))
- MaxPt (polar MaxPt Rotat (* Width 0.5))
- )
- )
- ((= Align 8)
- (setq MinPt (polar InsPt Angl1 (* Width 0.5))
- MaxPt (polar InsPt (+ Angl0 pi) Heigh)
- MaxPt (polar MaxPt Rotat (* Width 0.5))
- )
- )
- ((= Align 3)
- (setq MinPt (polar InsPt Angl0 Heigh)
- MinPt (polar MinPt Angl1 Width)
- MaxPt InsPt
- )
- )
- ((= Align 6)
- (setq MinPt (polar InsPt Angl0 (* 0.5 Heigh))
- MinPt (polar MinPt Angl1 Width)
- MaxPt (polar InsPt (+ Angl0 pi) (* 0.5 Heigh))
- )
- )
- ((= Align 9)
- (setq MinPt (polar InsPt Angl1 Width)
- MaxPt (polar InsPt (+ Angl0 pi) Heigh)
- )
- )
- )
- (list
- MinPt
- (polar MinPt Rotat Width)
- MaxPt
- (polar MaxPt Angl1 Width)
- )
- )
- )
- )
|