Dear All,
Is there any way to convert Text to Attribute Text.?
Because i need to extract text to excel.
Please find the attached .dwg file give me a solution.
Thank you in advance.
Solved! Go to Solution.
Solved by Alfred.NESWADBA. Go to Solution.
There is no way to automatically turn text or mtext objects into attribute text using standard AutoCAD commands. You could manually create these attribute definitions and match the properties of the text or mtext object.
There are also LISP routines that can help you automate this task.
See this forum post. The solution provided by @clindner is particularly relevant to your question.
Dear Mr.Williams,
I'm really sorry to say this, i cloud not understand that.
Can you please explain me little more.
i load the LISP file and i don't know how to use this below comments.
Please guide me.
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)
Hi @mohamedahsaan126 ,
I have created a .lsp file from the relevant post to lessen confusion. Please download the .lsp file attached to this post and use the APPLOAD to load the LISP file. Once the script file is successfully loaded, you can use any of the commands listed below to activate the script.
I hope this better explains how to use this LISP script.
Dear Mr.Williams,
Thank you very much for your clear explain.
LISP file is working but it's not full filling my requirement.
Text convert to attribute but with only tag(please refer screen shot). There is no value added.
And i can not do export attribute. Please can you try on my work sheet, maybe something wrong on my sheet.i'll attached here.
My aim for this only need to export data.
Once again thank you for your valuable time.😊😊
Hi @mohamedahsaan126 ,
We have reached the limit of my abilities with the LISP language. If you need further help, you can reach out to the AutoCAD Customization LISP forum and see if there is someone there who can help you modify the script to better fit your needs.
Dear Mr.Williams,
Thank you for your effort.
And i found one solution to extract that data.
First i change "every single manhole data" text to MTEXT by manually.
Then i'm using (DX)Data Extraction to get data in Excel.
Any way thank you for your support.
Hi,
>> Because i need to extract text to excel.
You can use command _DATAEXTRACTION to export Text content to Excel.
Why would you like to convert it to an attribute before?
- alfred -
Dear Mr.Williams,
YES, my only aim was extract text to excel.
That time i don't know about "DATA-EXTRACTION" for text, but i know "ATTRIBUTE EXPORT" for attribute text.
That's way i asked help to convert Text to attribute.
Any how i got one solution.
Thank your so much for your valuable time spending for me.
Hi,
>> That time i don't know about "DATA-EXTRACTION" for text,
>> but i know "ATTRIBUTE EXPORT" for attribute text.
Just to make sure, you understood that _DATAEXTRACTION is a command inside AutoCAD ... and that it helps you can export text objects direct to XLS without the need of converting anything?
Just look >>>here<<< to get more information about that command (it could help in the future too).
- alfred -
You may also want to explode the ATTOUT command that is part of AutoCAD's Express Tools.
Regards,
Chris
Please use the Accept as Solution or Kudo buttons when appropriate
Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors
Can't find what you're looking for? Ask the community or share your knowledge.