Visual Basic Customization

Reply
Active Member
benzadeus
Posts: 7
Registered: ‎06-29-2012
Message 1 of 16 (4,991 Views)

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

4991 Views, 15 Replies
06-29-2012 07:52 AM

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
New Member
msincla1
Posts: 1
Registered: ‎07-12-2012
Message 2 of 16 (4,947 Views)

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

07-12-2012 02:42 PM in reply to: benzadeus

Well done.  Very helpful. 

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 3 of 16 (4,939 Views)

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

07-13-2012 03:08 AM in reply to: benzadeus

Felipe, thanks so much for your amazing work,

 

Regards,

 

Oleg

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
New Member
truptigandhi
Posts: 2
Registered: ‎06-30-2011
Message 4 of 16 (4,001 Views)

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

03-16-2013 02:38 AM 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

Active Member
benzadeus
Posts: 7
Registered: ‎06-29-2012
Message 5 of 16 (3,996 Views)

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

03-16-2013 06:03 AM 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
New Member
zamora.emilio
Posts: 1
Registered: ‎05-06-2013
Message 6 of 16 (3,705 Views)

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

05-06-2013 08:31 AM in reply to: benzadeus

Thanks for the addin, works excellent.

 

New Member
christian.krei
Posts: 1
Registered: ‎12-12-2013
Message 7 of 16 (2,029 Views)

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

12-12-2013 07:34 AM 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

Mentor
truss_85
Posts: 173
Registered: ‎02-13-2011
Message 8 of 16 (2,014 Views)

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

12-12-2013 11:00 PM in reply to: benzadeus

Thanks for sharing.

 

It is great.

 

Best Regards...

Member
thuanspam
Posts: 3
Registered: ‎03-26-2014
Message 9 of 16 (957 Views)

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

04-21-2014 08:59 PM 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!

Active Member
benzadeus
Posts: 7
Registered: ‎06-29-2012
Message 10 of 16 (932 Views)

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

04-22-2014 05:16 PM in reply to: thuanspam

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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community