VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CADXL addin: Import AutoCAD table/texts into Excel, edit, and export it back

19 REPLIES 19
Reply
Message 1 of 20
benzadeus
10690 Views, 19 Replies

CADXL addin: Import AutoCAD table/texts into Excel, edit, and export it back

Hello everybody, my name is Felipe Gualberto, I'm new in this forum and am an Excel enthusiast.

 

I don't use AutoCAD often but I've been scrathing it's model object surface lately because I changed my job and am having to work with AutoCAD drawings.

I maintain a Microsoft Office/VBA website in portuguese (Brazil) at http://www.ambienteoffice.com.br

 

I'd like to share something with you: I created a free add-in called CADXL with vba code unlocked that has two tools:

(A) - Import an AutoCAD table (with borders from class AcadLine) to Excel.

(B) - Import texts objets (texts, mtexts and attributes) to Excel.

 

After the import, you can freely edit the text of the objects and the make the changes to reflect the text objects in the actual drawing.

I can do that because for (A) I used the Comment property from Excel's Range Object to keep the Handle property of each cell or text, so you can freely filter your data and even use tools for filling cells, as long you don't change the text of the Comment property of each cell.

For (B) I createad an auxiliar column that keeps the Handle property. I also decided to display the X and Y coordinates of each text object.

 

Attention: This Add-in works only with Excel 2007 or later.

 

As I said before, I don't know if such thing already exist. Probably it does, as I noticed this is a common request from coworkers. This tool has been helping our departament a lot.

The page (only in portuguese) of my addin is at http://www.ambienteoffice.com.br/suplementos/cadxl/

I recommend visiting the website because even it has a lot of step-by-step pictures of how use the tool and I'm pretty that you can understand how it works even if you can't read portuguese.

The .rar direct link to download is http://www.ambienteoffice.com.br/suplementos/cadxl/exemplo.rar

This archive has 3 files: the actual Addin and two drawings.

 

How to use tool for a table (A):

1 - Open the file called CADXL.xlam. Excel will open and display a new menu in the ribbon called CADXL.

2 - Open the drawing called exemplo1.dwg. This drawing has a table with a text in each cell.

3 - Back to Excel, click on the CADXL menu and click on the button Obter Tabela (which means Get Table). When clicking, you may have the AutoCAD focus now. If you can't see, just Alt+Tab to AutoCAD.

4 - Select the entire table, including borders (you could select only a part of the tablea, but have to select the desired's cells' borders). After the selection, press Enter or right-click with the mouse.

5 - You will get the table at Excel. Make some changes and click the Executar Alterações button (which means make changes)

6 - Check your table in AutoCAD: the values you edited on Excel were changed.

 

How to use tool for a table (B):

Same as before, but try opening file exemplo2.dwg. Then, select the texts you want (including lines on your selection won't be a problem). You'll have all the texts at Excel. Edit them and click on the Executar Alterações button to reflect the changes at AutoCAD.

 

I'd like some feedback concerning my addin. What did you guys think? Is there another tool avaible for doing that? I might be reinventing the wheel. Worse yet, you guys don't use Excel at all.

 

For the code that gets a table, I had a pretty hard time because I had to create collections of X and Y lines intersections, then sorted and did a loop through all cells.

Felipe Costa Gualberto
http://www.ambienteoffice.com.br
Microsoft Excel MVP
19 REPLIES 19
Message 2 of 20
msincla1
in reply to: benzadeus

Well done.  Very helpful. 

Message 3 of 20
Hallex
in reply to: benzadeus

Felipe, thanks so much for your amazing work,

 

Regards,

 

Oleg

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 4 of 20
truptigandhi
in reply to: benzadeus

excellent tool!!

 

however,when i bring the coordinates data, it does not come in proper sequence,it is scattered randomly , can some thing be done about it??

 

 please let me know how to rectify this error

 

Thanks in advance..

 

Trupti

Message 5 of 20
benzadeus
in reply to: benzadeus

"when i bring the coordinates data, it does not come in proper sequence,it is scattered randomly"

Unfortunately, "proper sequence" is something that it is logical in a specific context for us humans. Programatically, that can't be done.

The texts aren't listed random either - they're listed in order they were selected. If you select more then one object, I think it is listed in the order they were created.

 

Tip: try using Excel's AutoFilter PosX and PosY to sort the texts.

Felipe Costa Gualberto
http://www.ambienteoffice.com.br
Microsoft Excel MVP
Message 6 of 20
zamora.emilio
in reply to: benzadeus

Thanks for the addin, works excellent.

 

Message 7 of 20
christian.krei
in reply to: benzadeus

Hi,

 

this tool looks great! I am just trying it out and I have the following task, that I want to use it for:

 

I need to extract data, that is being updated in AutoCad files into an excel sheet and if possible have the excel sheet automatically update, when I adjust the data in the AutoCad drawing.

Is this possible with your addin, or would it be something that could be added? I think this would be amazing to have to optimize the ACad Excel workflow for lots of people.

 

Thanks a lot in advance,

Christian

Message 8 of 20
truss_85
in reply to: benzadeus

Thanks for sharing.

 

It is great.

 

Best Regards...

Message 9 of 20
Anonymous
in reply to: benzadeus

It's very helpful to get table from AutoCAD, but when I change value and press "Executar Alterações", I receive the error

CADXL-err.JPG

 

Please help!

Message 10 of 20
benzadeus
in reply to: Anonymous

I am updating the tool and fixing issues. I learned a lot of AutoCAD VBA since the first version (jun/2012).

When I finish updating it, I'll notice you guys.

Thank you.

Felipe Costa Gualberto
http://www.ambienteoffice.com.br
Microsoft Excel MVP
Message 11 of 20
p0paj
in reply to: benzadeus

Hi benzadeus,

 

thank you for the macro - it looks promising, although I am not able to use it.

 

I am getting some kind of an error - see the pictures attached.

 

I am running Excel 2013, and have the macros enabled.

 

Would appreciate any info how to solve the problem.

 

Cheers,

NN



Message 12 of 20
benzadeus
in reply to: p0paj

Hello all,

 

Thank you for you patience.

 

The CADXL is completely remodeled, and now it is part of a much bigger addin. Please test it by downloading at http://www.ambienteoffice.com.br/excel/expressxl/

 

Any questions can be posted here. I'll answer!

 

Regards,

 

 

Felipe Costa Gualberto
http://www.ambienteoffice.com.br
Microsoft Excel MVP
Message 13 of 20
p0paj
in reply to: benzadeus

Hi Felipe,

Thank you for your tme and effort.

The Acad part of the macro is working partially - I can extract the text, but I  couldn't export the table content to Exel.

See the attached pictures, if they may be of any help to solve the problem.

Once again, thank you for your effort,
Cheers,
NN

Message 14 of 20
Anonymous
in reply to: benzadeus

Please let me know how to get English version?

Message 15 of 20
benzadeus
in reply to: p0paj

p0paj,

Thank you for testing it.

Could you send to me the drawing that you tried to import the table to Excel, so I can test and fix?

My e-mail is felipe at ambienteoffice.com.br

 

 

Felipe Costa Gualberto
http://www.ambienteoffice.com.br
Microsoft Excel MVP
Message 16 of 20
benzadeus
in reply to: Anonymous

thuanspam,

Unfortunately, there isn't an English version yet. However, I believe you don't have to know english to use the tool, just follow the pictures or use google translate to understand what is explained on my site - it is pretty easy.

Also, if you have any trouble, just ask me.

Thank you.

Felipe Costa Gualberto
http://www.ambienteoffice.com.br
Microsoft Excel MVP
Message 17 of 20
timwiese
in reply to: benzadeus

This sound good, but my need is just the opposite. After inserting an excel equipment schedule into an ACAD LT drawing, I would like to be able to edit the text in it...but cant find a way to do that.

 

Thanks for the help,

Tim

Message 18 of 20
benzadeus
in reply to: timwiese

Just create a simple table using lines and text as cells. Then, import the table to Excel, do the changes, and then export back.

Felipe Costa Gualberto
http://www.ambienteoffice.com.br
Microsoft Excel MVP
Message 19 of 20
yuwono99
in reply to: benzadeus

Trying the ambienteXL macro, good to extract my oldtable in autocad.

for now using Acad2012 to create table ( using create table from acad menu) and have trouble to export to exel. could your macro include this function as well.( it s possible using conversion csv to export autocad table, but it will great if include in your macro)

Thanks. 

Message 20 of 20
muralik7KY37
in reply to: benzadeus

HI, 

The links dont work now. Is this available now?

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

Post to forums  

Autodesk Design & Make Report

”Boost