Author Topic: How to change attribute text height  (Read 3286 times)

0 Members and 1 Guest are viewing this topic.

GDF

  • Water Moccasin
  • Posts: 2081
How to change attribute text height
« on: August 25, 2016, 07:57:50 AM »
The code below with change the attribute text width, how can it be modified to change the text height?


Code: [Select]
(defun c:test (/ sset cnt enam attlst att)
  (setvar "cmdecho" 0)
   ;(ARCH:SET-ARIAL)
  (setq SSET
         (ssget
           "X"
           (list
             (cons 0 "INSERT")
             (cons
               2
               "*PN*"
             )
             (cons 8 "*A-,P-*,M-*,S-*")
           )
         )
        CNT 0
  )
  (if SSET
    (progn
      (repeat (sslength SSET)
        (setq ENAM (ssname SSET CNT)
              CNT  (1+ CNT)
        )
        (if (= (cdr (assoc 66 (entget ENAM))) 1)
          (progn
            (setq ATTLST (vlax-safearray->list
                           (variant-value
                             (vla-getattributes
                               (vlax-ename->vla-object ENAM)
                             )
                           )
                         )
            )
            (foreach
                   ATT
                      ATTLST
              (if
                (or (wcmatch (strcase (vla-get-stylename ATT)) "ARIAL")                     
                )
                 (progn
                   (ARCH:WORKING)
                   (vla-put-stylename ATT "ARIAL")
                   (vla-put-scalefactor ATT 1.0) ;;text width                   
                 )
              )
            )
          )
        )
      )
      (prompt
        "\n*      Attribute: Textstyle Notes completed      *"
      )
    )
  )
  (princ)
)
[\code]

Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

ChrisCarlson

  • Guest
Re: How to change attribute text height
« Reply #1 on: August 25, 2016, 08:11:02 AM »
Code - Auto/Visual Lisp: [Select]

It's still early in the Am but attribs should follow text properties

GDF

  • Water Moccasin
  • Posts: 2081
Re: How to change attribute text height
« Reply #2 on: August 25, 2016, 08:32:03 AM »
I already tried that...and got an activex error.

I found this by LeeMac
http://www.lee-mac.com/attmodsuite.html
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: How to change attribute text height
« Reply #3 on: August 25, 2016, 08:35:28 AM »
Thanks again Lee for all your great work & sharing with the community.  8)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

steve.carson

  • Newt
  • Posts: 108
Re: How to change attribute text height
« Reply #4 on: August 25, 2016, 11:31:39 AM »
Code - Auto/Visual Lisp: [Select]

It's still early in the Am but attribs should follow text properties

I'm still learning my VL stuff, but did a dump on an attribute and it appears the property you want is Height, not TextHeight, so try:

Code - Auto/Visual Lisp: [Select]


GDF

  • Water Moccasin
  • Posts: 2081
Re: How to change attribute text height
« Reply #5 on: August 25, 2016, 12:07:16 PM »
Thanks Steve
That did the trick
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

ronjonp

  • Needs a day job
  • Posts: 7528
Re: How to change attribute text height
« Reply #6 on: August 25, 2016, 03:12:01 PM »
All of these properties are also available by using vlax-dump-object, or in the developer help :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC