TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: GDF on August 25, 2016, 07:57:50 AM

Title: How to change attribute text height
Post by: GDF 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]

Title: Re: How to change attribute text height
Post by: ChrisCarlson 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
Title: Re: How to change attribute text height
Post by: GDF 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
Title: Re: How to change attribute text height
Post by: CAB on August 25, 2016, 08:35:28 AM
Thanks again Lee for all your great work & sharing with the community.  8)
Title: Re: How to change attribute text height
Post by: steve.carson 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]

Title: Re: How to change attribute text height
Post by: GDF on August 25, 2016, 12:07:16 PM
Thanks Steve
That did the trick
Title: Re: How to change attribute text height
Post by: ronjonp 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 (http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-E24E7CA0-0120-4C55-BADB-46D701B8D4CB) :)