PDA

View Full Version : Create routine to extract areas



Rebecca Cooper
2005-02-21, 09:08 PM
I am trying to automate the process of extracting room areas from a drawing into excel so that I can calculate the appropriate CFM for each room. I'm working on vanilla AutoCAD 2005.
So far I have recreated the routine that will extract the object handle and assign an attribute to it. (Listed on Autodesk website) but I want to change it so that it takes the area of the polyline automatically instead.
What I'm trying to eventually accomplish is extracting the handles and areas from AutoCAD for every pline on a specific layer. Those go to Excel, Excel performs the calculations and then the data comes back to AutoCAD in the form of a text box that lists the handle, area and total CFM from the calculation. That way if and when some data changes, I don't have to redo all of the calculations, I just have to re-run the program and they'll all update.
For now I'd settle for just getting all of the areas into excel.

Rebecca

Ed Jobe
2005-02-22, 09:51 PM
You don't need Excel and you don't need to do any calculations. The AcadLWPolyline object has an area property. Just grab that and put it into a peice of text. You may need to check to see if the lwp is closed or not.

Rebecca Cooper
2005-02-22, 10:05 PM
I need Excel to calculate the CFM from the area of the room.
I've managed to get the routine to extract the object handle and the area (in square inches) into excel, but I'm still working on improving the rest.

Ed Jobe
2005-02-22, 10:21 PM
Sorry, forgot about the cfm part, but the Area prop should help you some. Sounds like you're on the right track.