LISP: Please help me to find a lisp to add texts to block attributes

LISP: Please help me to find a lisp to add texts to block attributes

eorb107
Explorer Explorer
1,833 Views
9 Replies
Message 1 of 10

LISP: Please help me to find a lisp to add texts to block attributes

eorb107
Explorer
Explorer

Capture.PNGCapturee.PNG

 

 

Hello AutoCAD community,

 

I'm looking for a lisp to add multiple texts to my block attributes.

 

I used to have a lisp named "Addnotes" for this purpose but I lost it.

 

Please help!!

 

0 Likes
1,834 Views
9 Replies
Replies (9)
Message 2 of 10

TheCADnoob
Mentor
Mentor
0 Likes
Message 3 of 10

braudpat
Mentor
Mentor

 

Hello

 

What do you need exactly ?

 

- Add Text NEAR Insertion point of Blocks ?

The TNI routine seems OK !?

 

- Add Text to ONE attribut as a Suffix ?

or to ALL SAME attributes ?? coming from the SAME Block Name

 

- Add Text to ONE attribut as a Prefix ?

or to ALL SAME attributes ?? coming from the SAME Block Name 

 

Happy New Year and THE HEALTH, Regards, Patrice

 

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


0 Likes
Message 4 of 10

Ranjit_Singh
Advisor
Advisor

To add all those attributes, it may get annoying to open the attribute editor. Try using in place edit (attipedit command)

If you need a LISP to automate the process then there needs to be some logic on how those attributes change between blocks (increment, decrement, etc.) See Braudpat's comments. Explain more. A sample drawing with blocks will be even better.

0 Likes
Message 5 of 10

eorb107
Explorer
Explorer

Thank you so much for your reply.

I'll look into that.

0 Likes
Message 6 of 10

eorb107
Explorer
Explorer

Thank you so much for your reply.

Yes I need more than just editing the texts inside the attributes but attpedit will help in the future for sure.

Thank you again!

 

0 Likes
Message 7 of 10

eorb107
Explorer
Explorer

Sorry my explanation wasn't so detailed.

Here is what I need

Capture.PNG

Capturee.PNG

 

As you can see there're mtext, texts and texts inside the block attribute respectively.

The mtext is what we get when we first start a new job.

Then we explode the mtext to individual text lines.

Our job is to insert the texts into the attributes and I'm wondering if there's a lisp that can add those texts to an empty attribute.

Thank you so much for your reply.

Here's an DWG file for those photos.

0 Likes
Message 8 of 10

ВeekeeCZ
Consultant
Consultant

Would not be a better option to have all those white lines as the single multi-line attribute?

See the dwg. 

0 Likes
Message 9 of 10

eorb107
Explorer
Explorer

Hello,

 

Yes we asked our customer if we can use the single multi-line attribute in the past but their standard doesn't allow that.

 

My company has been using an encrypted lisp from this one company for this particular attribute group and the company is not allowing us to use the lisp

 

anymore. So I'm trying to find a lisp that is similar to the one I've been using. 

 

Thank you so much for your input!

 

 

0 Likes
Message 10 of 10

cadwomen
Collaborator
Collaborator
Hy may something like this ? https://lispbox.wordpress.com/2014/11/25/convert-text-to-attribute/ by danglar71 in Attribute, Lisp Collection 2014 ≈ Leave a comment . (defun c:txt2att (/ ss i en ed) (while (not ss) (princ "\nSelect TEXT to Convert to ATTDEF: ") (setq ss (ssget (list (cons 0 "TEXT") (if (getvar "CTAB") (cons 410 (getvar "CTAB")) (cons 67 (- 1 (getvar "TILEMODE")))))))) (setq i (sslength ss)) (while (not (minusp (setq i (1- i)))) (setq en (ssname ss i) ed (entget en)) (if (wcmatch (cdr (assoc 1 ed)) "* *") (alert "\nString Contains Spaces - Try Again...") (progn (entmake (list (cons 0 "ATTDEF") (assoc 8 ed) (assoc 10 ed) (assoc 11 ed) (assoc 7 ed) (assoc 40 ed) (assoc 41 ed) (assoc 50 ed) (assoc 51 ed) (cons 70 0) (assoc 71 ed) (assoc 72 ed) (cons 74 (cdr (assoc 73 ed))) (assoc 210 ed) (cons 1 "") (cons 2 (cdr (assoc 1 ed))) (cons 3 (cdr (assoc 1 ed))) (if (assoc 6 ed) (assoc 6 ed)'(6 . "BYLAYER")) (if (assoc 39 ed) (assoc 39 ed)'(39 . 0)) (if (assoc 62 ed) (assoc 62 ed)'(62 . 256)))) (entdel en)))) (redraw) (prin1)) (c:txt2att) cu cw
If my post answers your question, please mark it as an Accepted Solution, so that others can find answers quickly!
0 Likes