need Lisp routine for setting text height in paperspace layouts

Discussion in 'AutoCAD' started by Mark Sulzbach, Apr 15, 2004.

  1. To anyone who can help

    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:

    Website: www.atsiinc.com
     
    Mark Sulzbach, Apr 15, 2004
    #1
  2. Mark Sulzbach

    jclaidler Guest

    Do you have a height set for the text style in the Text Style Manager ??
     
    jclaidler, Apr 15, 2004
    #2
  3. Mark Sulzbach

    Jamie Duncan Guest

    (SETVAR "TEXTSIZE" (* 0.125 (if (= (GETVAR "DIMSCALE") 0) 1 (getvar
    "dimscale"))))


    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)
     
    Jamie Duncan, Apr 15, 2004
    #3
  4. This will help with text on the paperspace layout itself but I'm looking to
    write a lisp routing that will
    take the scale of the active viewport (say 1/4"=1'-0" or 1:48) and set text
    height to plot height of 1/8" in model space
    (example: 6" for 1/4"=1'-0")
     
    Mark Sulzbach, Apr 15, 2004
    #4
  5. Mark Sulzbach

    jclaidler Guest

    try this: I use this when switching to model space.

    (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)
     
    jclaidler, Apr 15, 2004
    #5
  6. you need to get the scale property of the active viewport and apply that to
    your text height

    --


    Jamie Duncan

    Consulting - If you're not part of the solution, there's good money in
    prolonging the problem.
     
    Jamie Duncan \(remove lock to reply\), Apr 15, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.