Export of Single Line Text from Multiple Drawings to Excel

Export of Single Line Text from Multiple Drawings to Excel

AbdulBasit1473
Contributor Contributor
2,832 Views
14 Replies
Message 1 of 15

Export of Single Line Text from Multiple Drawings to Excel

AbdulBasit1473
Contributor
Contributor

How to Export of Single Line Text from Multiple Drawings to Excel

0 Likes
2,833 Views
14 Replies
Replies (14)
Message 2 of 15

jayhar
Advisor
Advisor

Hi,

https://www.cadforum.cz/cadforum_en/how-to-export-autocad-drawing-texts-to-excel-tip8559

 

Please Mark the Post or Posts as Solution(s) to help others find the answer quickly. If your issue persists,

Please give me a bit more detail on this issue so we can continue to work towards getting this solved.

Thanks You
Jayhar.M.J

 

Helpful Links: Prepare your computer for download |  Autodesk Virtual Agent | Clean Uninstall | Steps for Setting-Up Student Software

 

Please Subscribe YouTube Channel
https://www.youtube.com/channel/UCclj8v9vHQiFa8_DriuAk3w

Please Mark the Post or Posts as Solution(s) to help others find the answer quickly.
0 Likes
Message 3 of 15

AbdulBasit1473
Contributor
Contributor

Hi

Already tested. It works only by Selection of Text manully  not for Multiple Drawings to extract single line text

0 Likes
Message 4 of 15

AbdulBasit1473
Contributor
Contributor

Text is available on Each File on Right Upper Corner 

Message 5 of 15

jayhar
Advisor
Advisor

Hi,

you can Add Multi drawing in DATAEXTRACTION

Please Subscribe YouTube Channel
https://www.youtube.com/channel/UCclj8v9vHQiFa8_DriuAk3w

Please Mark the Post or Posts as Solution(s) to help others find the answer quickly.
Message 6 of 15

AbdulBasit1473
Contributor
Contributor

DataExtraction gives out put in Single Column of Excel....

 

0 Likes
Message 7 of 15

AbdulBasit1473
Contributor
Contributor

See the Sample Files 

0 Likes
Message 8 of 15

Erense
Collaborator
Collaborator

Best way do do so:

Change the 'partslist' into a block with attributes.

Use these blocks and attributes to create your data-extraction.
Because there are different Tags you can seperate them in your extraction.

 

Hope this works for you.

 

 

 

If my post answers your question, please click the "Accept as Solution" button. This helps everyone find answers more quickly!

Kind regards,

Edwin Rense
Cadac Group AEC BV
Supporting Consultant AEC
Cadac Group .
0 Likes
Message 9 of 15

KLUG-TICIANO
Enthusiast
Enthusiast

Hi.

I use this solution, in this case only to active doc.

You can look for open, work and close doc, after know a one path, by a doc opened.

Ticiano 

=======================================

0 Likes
Message 10 of 15

AbdulBasit1473
Contributor
Contributor

I am unable to understand how to use SEND_TEXT-DEMO.zip

 

 

 

0 Likes
Message 11 of 15

KLUG-TICIANO
Enthusiast
Enthusiast

Hi. 

Do you use vba code in other case?

 

1) Copy vba code (excel) "Sub Send_Text ()" to auto cad vba editor, after line 3;

2) For this example left doc "T-TAD........" as active doc. Use other to see, too ;

3) Clear "A and B" collumns;

4) Run the macro;

5) All texts are in "A and B" collums (excel doc - only simple.text). To mulit.text and attribute.text we have to use another vba code;

 

If you want replace some or all text of a one doc use macro "posted yestarday" (11-10-18) too, picking before all text in collumn "B". After, write new text in collumn "C", and run "Replace_text....." . Rewrite texts that will continue or delete line.

 

Ticiano ([email protected])

0 Likes
Message 12 of 15

AbdulBasit1473
Contributor
Contributor

Example file missing in attachment

0 Likes
Message 13 of 15

KLUG-TICIANO
Enthusiast
Enthusiast

Hi. 
Some people have problem  with attached file, them I send this.

1) Copy vba code "Sub Send_Text ()", in the end, to auto cad vba editor;
2) Use any autocad doc with simple text (active doc). Use others too ;
3) Open Excel and use a plan active with  "A and B" collumns clears;
4) Run the macro;
5) All texts will be send to  "A and B" collumn  (excel doc - only simple.text). To mulit.text and attribute.text we have to use other vba code;

In other problem (case), if you need replace some or all text of a one doc use macro "posted yestarday" (11-10-18) too, picking before all text in collumn "B". After, write new text in collumn "C", and run "Replace_text....." . Rewrite texts in collumn "C" that will continue or delete line. 
I want  know if now is ok.
Thank you.
Ticiano ([email protected])
================================================================================
VBA CODE:
Sub SendText()
'IN THIS CASE, ONLY SINGLETEXT AND ACTIVEDOC
'CLEAR COLUMM "A" AND "B" (EXCEL) AND RUN THE VBA
Dim obj As AcadObject
Dim ent As AcadEntity
Dim text As AcadText
'Dim blk As AcadBlock
DDOC = ThisDrawing.Name
DOC_PATH = ThisDrawing.Path
Set APPX = GetObject(, "Excel.Application")
tot_ent = ThisDrawing.ModelSpace.count
Lin = 1
For i2 = 0 To tot_ent - 1
TYPE_ENT = ThisDrawing.ModelSpace.Item(i2).ObjectName
If TYPE_ENT <> "AcDbText" Then GoTo 80
45 AUX04 = ThisDrawing.ModelSpace.Item(i2).handle
Set text = ThisDrawing.HandleToObject(AUX04)
APPX.Cells(Lin, 1).Value = Lin
APPX.Cells(Lin, 2).Value = text.TextString
Lin = Lin + 1
80 Next i2
1000 End Sub
===============================================================================

0 Likes
Message 14 of 15

AbdulBasit1473
Contributor
Contributor

Hi Thanks ..

It is working for Whole drawing ... Can we limit it to certain area of the drawing to select the required text only.

 

0 Likes
Message 15 of 15

KLUG-TICIANO
Enthusiast
Enthusiast

Hi.

This macro transfer singletexts selected by a windows in the drawing.

This selection may be a small or a big window.

Bye.

Ticiano ([email protected])

0 Likes