- UID
- 525
- 积分
- 3148
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-14
- 最后登录
- 1970-1-1
|
发表于 2003-11-4 05:32:33
|
显示全部楼层
最初由 nore 发布
[B]在多行文字中可以控制,如果是单行文字就难些了 [/B]
单行文字也可以:
;Text_Align_Vert.LSP May 19, 2003 Donald B. Smith, P.E.
;REV: LU.LSP JUL 27, 1997 Greg Bernotas
;REV: LINE-UP.LSP OCT 9, 1991 Kent Keller
;REV: DINTER OCT 9, 1991 P. Legoy
;
;REVISED: This header and ability to line up any justification
; type text along the x-axis more efficently. The x and
; y line-up options were broken out into 2 seperate lisp
; files for quick pick action. See Text_Align_Horz.LSP
; for lining up text more efficiently along the y-axis.
;
;PURPOSE: This routine allows user to line up ANY existing
; text within a drawing along the Vertical (X) axis.
;
;ACTION: Initate routine with "tav".
;
(prompt "\nText_Align_Vert.lsp is loaded.")
(defun c:TAV (/ XORY PSET NU OLDECHO LINE-UP ENT VALUE
NU CT X X2 Y Y2 f f2)
(= XORY "X")
(setq VALUE (car (getpoint "\nSelect Vertical Location: ")))
(grdraw (list value (cadr (getvar "vsmin")))
(list value (cadr (getvar "vsmax"))) -3 1)
(defun LINE-UP (ENT XORY VALUE)
(setq x (cadr (assoc 10 ENT)))
(setq x2(cadr (assoc 11 ENT)))
(setq y (caddr (assoc 10 ENT)))
(setq y2(caddr (assoc 11 ENT)))
(setq f (cdr (assoc 72 ENT)))
(setq f2(cdr (assoc 73 ENT)))
(= XORY "X")
(and (= f 0) (= f2 0))
(setq ENT (subst (list 10 VALUE y) (assoc 10 ENT) ENT))
(setq ENT (subst (list 11 VALUE y2) (assoc 11 ENT) ENT)) (entmod ENT)
)
(setq PSET (ssget))
(if (/= PSET nil)
(progn
(SETQ NU 0)
(while (/= (ssname pset NU) nil)
(setq CT (ENTGET (ssname PSET NU)))
(if (equal (cdr (assoc 0 CT)) "TEXT")
(LINE-UP CT XORY VALUE)
)
(SETQ NU (+ NU 1))
)
)
)
(redraw)
(setvar "cmdecho" 1)
(princ)
)
(prompt "\nStart command with TAV")
(princ) |
|