EXTRACT DATA FROM CAD TO EXCEL

EXTRACT DATA FROM CAD TO EXCEL

Anonymous
Not applicable
3,579 Views
13 Replies
Message 1 of 14

EXTRACT DATA FROM CAD TO EXCEL

Anonymous
Not applicable

Hi everyone, first of all I would like to thank all who's helping us to make our drawings much easy with these auto-lisps. however I really hope if someone can make me a lisp of what am looking for or even if there's a program or any idea of how to do a material takoff for my drawings. what I am looking for is a lisp to extract the objects or data that I have in my cad to excel to make it as a schedule. what I want for now is area for vision glass, spandrel glass (SG), metal panel (MP) & louver (LV).

also sometimes I have two colours for vision or spandrel glass so I hope this lisp can read the hatch as long as its in separate layers, and gives me an area of each one in excel file.

 

also a lisp to count how many awning with width and height sizes.

how many sliding doors with width and height sizes and left or right direction.

how many swing door with width and height sizes also left or right opening.

 

for corners area and how many with exterior or interior corner.

 

last thing is for overall window area.

 

I hope if I can get something close to what am looking for, I would really appreciate it.

I will attached CAD file and pdf so see the way I want it to be, also please let me know if any of my drawings has to be modify to make it easier for the lisp. 

 

am doing high rise building and it takes me a too much time to count all of these specially when I work in building with 40 floors.

 

best regards,

 

Waseem 

0 Likes
3,580 Views
13 Replies
Replies (13)
Message 2 of 14

devitg
Advisor
Advisor

My way to do it , is to fit the DWG to the task to do . Do a unique layer for the whole unique items and set color bylayer to the meet the color Each item to square shall be a polyline , you can use the rectangle to hatch , and assign each one as the layer that identify it , also make polylines on windows vision glass-color 1 ....... vision glass-color n spandrel glass metal panel louver (LV) sliding door left sliding door right awning window sliding door left sliding door right

0 Likes
Message 3 of 14

Anonymous
Not applicable

Greetings Waseem,

 

Attached is a program that will calculate the area (in square feet) of each material you requested based on the drawing hatches provided on your sample and spits out a .CSV which is a universal file that will automatically open in excel. The downside is that it is the rawest a file gets so the formatting won't be pretty and there's no color coding or formatting that can be programmed into the file (that I am aware of), but once opened you could save it to excels native file very easily and all the formatting you do will be saved.

 

If this isn't a polished enough solution you may want to try your luck with the VBA section since that language is better to cross the 2 platforms. The downside there would be that you would need to download an enabler for VBA to work on every computer with a version of AutoCAD since 2016.

 

For the other objects on the docket... how would you like the files split up? I could throw them all in one file and command or separate them into individual ones.

 

I was hoping you could also expand on what you meant about the corners specifically their area and the difference in interior and exterior corners. 

 

Apologies if I'm shooting a lot back at you... Just got a ton of time and eager to help.

 

Regards,

Mitch

0 Likes
Message 4 of 14

Anonymous
Not applicable

@devitg sorry but I didn't get what you mean, my drawings are already in separate layers.

 

could you please be more specific 

 

thank you 

0 Likes
Message 5 of 14

Anonymous
Not applicable

@Anonymous 

 

I have tried your lisp, thank you for your help. however, this lisp need some adjustment

 

* I have tried to put a rectangular around the vision glass but when I used the lisp it didn't gave me anything.

* I have added another hatch and called it to be spandrel glass 2 but also didn't work and gave me an area for spandrel glass, if you could adjust the lisp to read the layers because some of the projects I have difference colors and need separate area.

* for awning or sliding door its already in block so if that lisp can read the block and gave a daylight opening area 

 

thank you in advance but the lisp is good so far but I hope if you could make these adjustment and I will try it until it works perfect so I can use it for any projects I get.

 

also what is VBA ? I have know idea about this. please advise me on how to use it or work on it.

 

regards,

 

Waseem 

 

0 Likes
Message 6 of 14

Anonymous
Not applicable

@Anonymous 

 

Hi Waseem,

 

The program was designed to calculate the area of only hatches on the layer and neglects other objects. Did you want rectangles on the glass layers to be calculated in?

 

As for the Spandel Glass 2, as long as you can provide a list of all the possible layers' specific names that need to be calculated into "Spandel Glass", then there will be no problem incorporating each condition in. 

 

Can you provide an example of how you would like the data to be presented for the sliding door and awning?

 

I attach an updated code that adds in the base and width of the awnings and doors. They are based on the dynamic blocks values for direction 1 and 2. Is it safe to assume these properties will be existent in all blocks of the type? And is there a standard direction they point in based on the rotation? I'm wondering because one door had the x and y  values transposed and I noticed the blocks had different rotations.

 

VBA is Visual Basic for applications, which is another of the many automation programming languages in AutoCAD. The big difference between the two languages is that VBA is also the automation language for Microsoft office among many other applications making the ability to talk to excel from AutoCAD far easier than with lisp.

 

Regards,

Mitch

0 Likes
Message 7 of 14

Anonymous
Not applicable

@Anonymous 

Hi Mitch,

 

after testing the program that you gave me, I need few things.

I have updated the drawings and uploaded with some notes on elevations.

 

the thing is hatches or names depends on each projects, sometimes we have one color and sometimes we have many colors, however I can adjust my drawings, layers & hatches to work with your program to make it more easy.

 

I do want area of the glass and tempered glass, so please let me know if I have to put a rectangular around, because I can't have hatch around glass, it also depends to the project, not all projects have hatches for the vision glass.

 

for awning, sliding door & euro door are always in dynamic blocks but might verify the height or width, depends on the project and the floors.

 

for the hatches I do have rectangular around, let me know if you want me to make rectangular for each hatch with different names so the program will work easily.

 

for VBA, I have no clue about it, but if it easier than lisp and works perfect then I don't mind to work with it whether by you or anyone who knows about it.

 

but if its hard to work with it then I prefer to stick with lisp.

 

thank you for your help, waiting for the adjustment, also if drawings need to be change in anything, then let me know.

 

regards,

 

waseem   

0 Likes
Message 8 of 14

Sea-Haven
Mentor
Mentor

If you do a bit more googling there are programs like getexcel.lsp out there that will read and write to excel. There are just so many examples for exporting to excel just need to find something close for what you want. Then edit to suit. Using programs like this you can open an existing excel and add cells etc. You should be able to change the way the cell looks as well.

 

From a simple point of view did you look at DATAEXTRACTION ?

0 Likes
Message 9 of 14

pmercader
Advocate
Advocate

If you are using attributes, use the ATTOUT command to export it into .txt file, just open that file in excel. Then use ATTIN to bring them back in after you have edited.

 

 

edit: Nevermind, I saw your file. ATTOUT wont work. But if you use attributes ATTOUT / ATTIN works like a charm. The thing with Data extraction is, it needs some sort of definition so when you extract it its not just a bunch of text - by making blocks with attributes you can extract them and sort it out easily.

0 Likes
Message 10 of 14

Anonymous
Not applicable

@Anonymous Hi Mitch,

 

is there any good news for the lisp ? please let me know when you get a chance. if it's hard to make this lisp also let me know so I know what to do for my projects.

 

regards,

 

waseem 

0 Likes
Message 11 of 14

devitg
Advisor
Advisor
Hi , the first to give help, shall be yourself. Lisp do not THINK, it only obey orders. As I post earley you have to suit or fit the dwg to the lisp. Eg: how do you thing , Lisp could know the sliding window side , right or left. So Lisp shall know where to find , each different object.
0 Likes
Message 12 of 14

Anonymous
Not applicable

@devitg I have updated and uploaded the drawings again to suit the lisp that has been done by Mitch.

however, drawings have separate layers. if I have 2 or 3 colours for spandrel or louver, I also will have different hatches and layers too. what I was asking is to adjust the lisp so it can read the layers specially for hatches cause I can't have an area for louver in the whole project if its different colours.

so according to your comment is the issue you have is with the sliding door, I do have an arrow showing if its left or right but I guess lisp can't read that. then what I would suggest is to count only sliding doors and euro doors with their sizes and I will do the left and right sides manual. 

 

so all I want now is 

 

Vision glass area

Metal panel area using all different hatches (separate the layers) 

Spandrel area using all different hatches (separate the layers) 

Louver area using all different hatches (separate the layers) 

 

Counting of sliding doors & euro doors with sizes

counting of awning with D.L.O. sizes both width and height 

 

Overall window area which means width x height 

 

I hope all is clear now, if not then please let me know.

 

regards,

 

waseem 

0 Likes
Message 13 of 14

Anonymous
Not applicable

hello everyone, its been a week since I send the last post, is there any good news about this lisp?

 

regards,

 

waseem 

0 Likes
Message 14 of 14

Anonymous
Not applicable

@Anonymous please see the upload file.

 

regards,

 

waseem 

0 Likes