AutoCAD Architecture Forum
Welcome to Autodesk’s AutoCAD Architecture Forums. Share your knowledge, ask questions, and explore popular AutoCAD Architecture topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Convert text to attribute

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
rhjakins
44042 Views, 9 Replies

Convert text to attribute

A call for assistance out to all of you cruizing the discussions...

Is there a way to convert normal or m text into attribute text for a block?

Any and all assistance in this will be appreciated.
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: rhjakins

What I do is just create an attribute tag, using ATTDEF.
... Just create a new one or copy an existing tag, and change its tag name.

THEN I use the paintbrush to match its properties (style/color/etc) to the
properties of the text or mtext I'm wanting to replace.
THEN I set its justification to what it needs to be.
THEN I set its default value to what it needs to be - (perhaps a specific
field).

That generally does the job.

hth,
David Kozina


wrote in message news:6230088@discussion.autodesk.com...
A call for assistance out to all of you cruizing the discussions...

Is there a way to convert normal or m text into attribute text for a block?

Any and all assistance in this will be appreciated.
Message 3 of 10
Anonymous
in reply to: rhjakins

OOPs, forgot to mention (after paintbrushing the properties)
THEN position/rotate the tag to where it should be.


"David Kozina" <"David Kozina"> wrote in message
news:6230141@discussion.autodesk.com...
What I do is just create an attribute tag, using ATTDEF.
... Just create a new one or copy an existing tag, and change its tag name.

THEN I use the paintbrush to match its properties (style/color/etc) to the
properties of the text or mtext I'm wanting to replace.
THEN I set its justification to what it needs to be.
THEN I set its default value to what it needs to be - (perhaps a specific
field).

That generally does the job.

hth,
David Kozina


wrote in message news:6230088@discussion.autodesk.com...
A call for assistance out to all of you cruizing the discussions...

Is there a way to convert normal or m text into attribute text for a block?

Any and all assistance in this will be appreciated.
Message 4 of 10
rhjakins
in reply to: rhjakins

Thanks David. I can and have done that. I was hoping there might be another method for doing this on a larger scale than a piece of text at a time. I don't know of any, which is why I was shooting the question out to the masses. Hoping someone out there had an idea for this.
Message 5 of 10
Anonymous
in reply to: rhjakins

There is no built-in command. For special applications, customization
languages are available. (LISP, VBA, .net...)


wrote in message news:6230143@discussion.autodesk.com...
Thanks David. I can and have done that. I was hoping there might be
another method for doing this on a larger scale than a piece of text at a
time. I don't know of any, which is why I was shooting the question out to
the masses. Hoping someone out there had an idea for this.
Message 6 of 10
zubair_exe
in reply to: rhjakins

 
Message 7 of 10
bobbyrubyii
in reply to: zubair_exe

Any way that you could modify this to keep the text at the same angle it was placed?

Tags (1)
Message 8 of 10
sharpl
in reply to: Anonymous

Any reson I am unable to match it? It still stays as mtext, is not converted into attribute? Thank you!

 

Message 9 of 10
clindner
in reply to: sharpl

Updated:

  • recognizes MText. Note: att tags can't contain spaces. If the selected text contains spaces, it will still work, but AutoCAD will slap your hand when you attempt to modify the ATTDEF settings.
  • uses selected text's angle and height
  • added alternate function names: MTXT2TAG, TXT2ATT, & MTXT2ATT

 

(defun c:txt2tag (/ oldcmd ss)
  (setq oldcmd (getvar "CMDECHO")) (setvar "CMDECHO" 0)
  (if (setq ss (ssget (list (cons 0 "TEXT,MTEXT")
                            (if (getvar "CTAB")
                              (cons 410 (getvar "CTAB"))
                              (cons 67 (- 1 (getvar "TILEMODE")))))))
    (progn
      (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
        (command "-attdef"
		 "" ; settings
		 (cdr (assoc 1 (entget e))) ; tag name
		 "" ; prompt
		 "" ; default value
                 (cdr (assoc 10 (entget e))) ; ins pt
		 (cdr (assoc 40 (entget e))) ; height
		 (cdr (assoc 50 (entget e))) ; rotation
		 )
        (entdel e)))
    (princ "\nError: no text selected."))
  (setvar "CMDECHO" oldcmd)
  (princ))
(defun c:txt2att () (C:txt2tag))
(defun c:mtxt2att () (C:txt2tag))
(defun c:mtxt2tag () (C:txt2tag))
(princ)


Please use the Accept as Solution or Kudo buttons when appropriate

Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors

Message 10 of 10
steve.i.s
in reply to: clindner

Can you also make it match text justification?

Or at least justify the attribute middle center.

Please and thank you.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost