I have a very simple lisp routine to set text layer, color & height to 1/8"
when paperspace
layouts are not used & dimscale is set to a variable such as "48".
(DEFUN C:DT()
(COMMAND "LAYER" "M" "M-TEXT" "")
(COMMAND "COLOR" "BYLAYER")
(SETVAR "TEXTSIZE" (* 0.125 (GETVAR "DIMSCALE")))
(COMMAND "DTEXT"))
However once you set "scale dimensions to paperspace (layout)" in the
"dimension style manager", the dimscale becomes "zero" and this no longer
works.
When using paperspace layouts all dims & text are in modelspace with
objects. Dimensions are scaled automatically by AutoCAD, but I have to
remember text size & switch for every viewport on the dwg. (1/4"=1'-0" = 6"
text, etc...)
I can't figure out the system variable (if any) for the active viewport so I
can automatically scale text.
"textsize" "'spacetrans" "1/8" works only if you type it but does not seem
to wouk in a lisp routine. Apparently you can not use commands
transparently in Auto Lisp.
I WAS TRYING:
(DEFUN C:PT()
(COMMAND "LAYER" "M" "M-TEXT" "")
(COMMAND "COLOR" "BYLAYER")
(COMMAND "TEXTSIZE" "'SPACETRANS" ".125")) ;COMMAND OR SETVAR
(COMMAND "DTEXT"))
HOWEVER THIS WILL NOT ACCEPT " 'SPACETRANS "
I can't be the only person to ever run into this, although most people
"solve" this problem by simply putting all text on layout with title block.
This is not a desired solutions since the object & dims (modelspace) will
then be separate from all leaders & text (paperspace).
Please advise.
Mark
--
Mark Sulzbach
Designer
ATSI, Inc.
415 Commerce Dr.
Amherst, NY 14228
Phone: 716-691-9200 ext 266
FAX: 716-691-7221
email: msul...@atsiinc.com
Website: www.atsiinc.com
like this?
--
Jamie Duncan
"How wrong it is for a woman to expect the man to build the world she wants,
rather than to create it herself."
- Anais Nin (1903-1977)
"Mark Sulzbach" <msul...@atsiinc.com> wrote in message
news:407e80ce$1_3@newsprd01...
"Jamie Duncan" <dagnyt...@thejohngaltline.com> wrote in message
news:407e84bf_2@newsprd01...
(setq Fac (/ 12 (* 12 (caddr (trans '(0 0 1) 2 3)))))
(command "pspace")(setvar "tilemode" 1)
(setvar "dimscale" Fac)(setvar "ltscale" (/ Fac 2.0))
(SETVAR "TEXTSIZE" (* 0.09375 (if (= GETVAR "DIMSCALE") 0) 1 (getvar "dimscale"))))
(princ "\nDIMSCALE: ")(princ Fac)
(princ " LTSCALE: ")(princ (getvar "ltscale"))
(command "regenall")
(setvar "cmdecho" 1)
(princ)
;; handle nonsense case of zero dimscale in tiled space
(if(and(= 0 (getvar "DIMSCALE"))(= 1 (getvar "TILEMODE")))
(progn((alert " Zero Dimension Scale\n Set Tilemode = 0 or
Use a Non-Zero Dimension Scale")(exit))))
Note: I don't presently like using (exit) this way, but this was lifted
from an old routine which I haven't changed. There are cleaner ways to
do this check.
Then just
(setvar "TEXTSIZE" (* 0.125 (getscl)))
or maybe
(setvar "TEXTSIZE" (* (getvar "DIMTXT") (getscl)))
--
Jamie Duncan
Consulting - If you're not part of the solution, there's good money in
prolonging the problem.
"Mark Sulzbach" <msul...@atsiinc.com> wrote in message
news:407e8ddc$1_3@newsprd01...