Global Text Style Height Change F1

Discussion in 'AutoCAD' started by akdrafter, Apr 7, 2004.

  1. akdrafter

    akdrafter Guest

    Hello All,

    Anyone have a nifty neato lisp routine to change "All" text style heights to 0 (non-fixed)?

    Thanks.

    "Catch" Ya Later,
    AKDRAFTER
     
    akdrafter, Apr 7, 2004
    #1
  2. akdrafter

    Walt Engle Guest

    Yes - see below. But, just out of curiosity, why would you want to change the height to zero
    (0)?

    (defun c:chgts ()
    (setvar "cmdecho" 0)
    (setq a (ssget))
    (setq b (sslength a))
    (menucmd "s=textsize")
    (setq c (getdist "\nENTER NEW TEXT SIZE: "))
    (if (<= c 0.125)(command "-layer" "s" "0" ""))
    (if (> c 0.125)
    (progn
    (if (<= c 0.375)(command "-layer" "s" "0" ""))
    (if (> c 0.375)(command "-layer" "s" "0" ""))
    )
    )
    (while (> b 0)
    (setq b (1- b)
    d (ssname a b)
    d (entget d)
    e (assoc 40 d)
    f (cons 40 c)
    )
    (entmod (setq d (subst f e d)))
    )
    (setq a nil)
    (princ)
    )
     
    Walt Engle, Apr 7, 2004
    #2
  3. Looks like this would change the height of all text entities in the drawing
    (to whatever size you give it), but I took the original post to mean they
    were looking for a way to set the height of all defined text STYLES to zero
    (non-fixed-height). [Not that I know how to do that, or anything....] Is
    that right?

    Kent Cooper, AIA

    ...
     
    Kent Cooper, AIA, Apr 7, 2004
    #3
  4. akdrafter

    David Kozina Guest

    Height 0 makes for flexible text usage with fewer styles...
    so, how 'bout?:

    (defun C:TSH0()
    (vlax-for _obj
    (vlax-get-property
    (vlax-get-property
    (vlax-get-acad-object)
    'ActiveDocument
    )
    'TextStyles
    )
    (vlax-put-property
    _obj
    'Height
    )
    0.0
    )
    );_end defun


    hth,
    David Kozina


     
    David Kozina, Apr 7, 2004
    #4
  5. akdrafter

    Jeff Mishler Guest

    And a non-vl version.....

    (defun c:styl2zero (/ styl)
    (while (setq styl (tblnext "style" (not styl)))
    (setq styl (entget (tblobjname "style" (cdr (assoc 2 styl)))))
    (entmod (subst (cons 40 0.0) (assoc 40 styl) styl))
    )
    (princ)
    )

    Jeff

     
    Jeff Mishler, Apr 7, 2004
    #5
  6. akdrafter

    David Kozina Guest

    I *always* forget the (princ) at the end...
    :(


     
    David Kozina, Apr 7, 2004
    #6
  7. akdrafter

    David Kozina Guest

    Fer pete's sake...

    (defun C:TSH0()
    (vlax-for _obj
    (vlax-get-property
    (vlax-get-property
    (vlax-get-acad-object)
    'ActiveDocument
    )
    'TextStyles
    )
    (vlax-put-property
    _obj
    'Height
    0.0 ;<- this should work bet-tah
    )
    )
    (princ) ;)
    );_end defun
     
    David Kozina, Apr 7, 2004
    #7
  8. akdrafter

    akdrafter Guest

    Jeff,

    Exactly what I needed. Works great. Thank you sir.

    To others,

    My goal was to take all "Defined" text styles and set their height to 0 which is what Jeff provided.

    "Catch" Ya Later,
    AKDRAFTER
     
    akdrafter, Apr 7, 2004
    #8
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.