AutoLisp - Text to Block Attribute

AutoLisp - Text to Block Attribute

eduardosforni
Participant Participant
618 Views
2 Replies
Message 1 of 3

AutoLisp - Text to Block Attribute

eduardosforni
Participant
Participant

Hi!

I need a lisp routine that change a bulk of blocks attribute based on list of text previously selected, someone know a lisp routine does that?

Example.:
I select some texts then
select the same number of blocks
press enter
then the previously selected texts become the sixth attribute of my block.

Thank you

0 Likes
619 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

the thing can be easy done if you want to select a text and use it as attribute but how do u think to chose which text will be used for each block?

0 Likes
Message 3 of 3

ВeekeeCZ
Consultant
Consultant

Here's the code. Fill up a TAG of your 6th att.

 

(defun c:TextToBlock ( / s e)

  (if (and (setq s (ssget '((0 . "TEXT"))))
	   (setq e (entsel "\nSelect a block: "))
	   )
    (setpropertyvalue e "TagOfYour6thAtt" (cdr (assoc 1 (entget (ssname s 0))))))
  (princ)
  )

 

0 Likes