Author Topic: Attribute height change routine  (Read 1985 times)

0 Members and 1 Guest are viewing this topic.

TJAM51

  • Guest
Attribute height change routine
« on: April 08, 2005, 11:50:52 AM »
How can the following routine be changed to do crossing, window, or single selevction sets? Thanks

Code: [Select]

;;;Attribute height change
(defun c:ahc ()
(setq atth(getreal "\nEnter new attribute height: "))
(command "attedit" "y" "*" "*" "*" "c" pause pause)
(while
(= 1 (logand (getvar "cmdactive") 1))
(command "h" atth "n")
);;; end while
);;; end lisp

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Attribute height change routine
« Reply #1 on: April 08, 2005, 12:23:29 PM »
A real quick spin on a different approach ...

Code: [Select]
(defun c:ahc ( / ss i height insert )
    (cond
        (   (setq ss (ssget '((0 . "insert")(66 . 1))))
            (initget (+ 1 2 4))
            (setq height (getreal "\nNew attribute height: "))
            (repeat (setq i (sslength ss))
                (foreach attribute
                    (vlax-invoke
                        (setq insert    
                            (vlax-ename->vla-object
                                (ssname ss (setq i (1- i)))
                            )
                        )
                        'GetAttributes
                    )
                    (vla-put-height
                        attribute
                        height
                    )    
                )
                (vla-update insert)                
            )
        )    
    )
    (princ)    
)

Also, see this.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

TJAM51

  • Guest
Attribute height change routine
« Reply #2 on: April 08, 2005, 12:35:37 PM »
:D  :D OUTSTANDING...THANKS

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Attribute height change routine
« Reply #3 on: April 08, 2005, 12:36:13 PM »
My pleasure.

;)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst