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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.