Author Topic: Match Attribute Height  (Read 1830 times)

0 Members and 1 Guest are viewing this topic.

Biscuits

  • Swamp Rat
  • Posts: 502
Match Attribute Height
« on: March 12, 2008, 01:51:56 PM »
Using Windows XP with Autocad2008.

I'm looking for a routine to select an attribute (to obtain text height)
then select other attributes to change their text height to match the previous selection.

Would appreciate any assistance with this.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Match Attribute Height
« Reply #1 on: March 12, 2008, 01:55:29 PM »
Look at 'nentsel' to select the first attribute.  Then grab the Height property.  Then use the routine here to select the other attributes.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

deegeecees

  • Guest
Re: Match Attribute Height
« Reply #2 on: March 12, 2008, 02:08:10 PM »
Need more?

(setq en1 (entget (car (nentsel))))
(setq en2 (cdr (assoc 40 en1)))

deegeecees

  • Guest
Re: Match Attribute Height
« Reply #3 on: March 13, 2008, 11:54:40 AM »
So, any progress?

Biscuits

  • Swamp Rat
  • Posts: 502
Re: Match Attribute Height
« Reply #4 on: March 13, 2008, 12:25:12 PM »
Poor lsp skills and time constraints are my excuses for little progress for now.
Not sure how to combine your statements with T.Willey's

Thanks for your help

deegeecees

  • Guest
Re: Match Attribute Height
« Reply #5 on: March 13, 2008, 12:29:47 PM »
I'll see if I can whip something up for you then. I've got a little time.

deegeecees

  • Guest
Re: Match Attribute Height
« Reply #6 on: March 13, 2008, 12:53:08 PM »
My general disclaimer applies - "It aint pretty but it works"

There is a regen after each selection, and the variables aren't reset, but I've run out of time to make it a bit more friendly. Others here could probably do quite a bit better, but hey, it works.

Enjoy!

Code: [Select]
;match_att_ht.lsp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;start prog

(defun c:match_att_ht ()
(setq en1 (entget (car (nentsel))))
(setq en2 (cdr (assoc 40 en1)))
(setq cntr1 1)
(while (= 1 cntr1)
(setq ent1 (nentsel "\nSelect any text object <HIT ESC TO STOP>:" ))
(setq en1-2 (car ent1))

(setq en3 (entget (car Ent1)))

   (setq en3
                   (subst(cons 40 en2)
                         (assoc 40 en3)
                         en3))
        (entmod en3)
        (entupd en1-2)
(command "regen")
(princ)
);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;while

)

Biscuits

  • Swamp Rat
  • Posts: 502
Re: Match Attribute Height
« Reply #7 on: March 13, 2008, 01:47:16 PM »
Lookin' purty to me!

Thank you.

Works great.

deegeecees

  • Guest
Re: Match Attribute Height
« Reply #8 on: March 13, 2008, 01:57:49 PM »
Not a problem (today anyway)!