- Calculate the length of all polylines, as well as the area of all closed polylines from a selected layer.
- Calculate the length of all polylines, as well as the area of all closed polylines from all the layers of the current drawing.
- Export the results to a new Excel workbook.
I should point out that the add-in calculates the area from closed polylines only. So, this means that when the polyline was drawn, the closed option should have been used at the end. If a polyline was left opened or it was manually closed (by linking the last point with the first point), then the code will not take its area into account. However, its length will be measured. The video below has an example of polylines who look closed but they aren’t.
- Open your AutoCAD.
- In command line write VBAMAN.
- Press the Load button in the menu that will appear.
- At the browser find the file Polyline Area.dvb.
- Choose the Enable Macros button and then press the Macros button.
- At the macros menu, press the Run button. A form will appear (see figure above).
- In the form you have two choices: you can either select a layer from the combo box or you can check the check box to loop through all the layers of the current drawing. In both cases press the Calculate Length & Area button after. The list box will be populated with information from all the polylines of the selected layer or all the layers of the drawing. Two text boxes below the list box will contain the total length and the total area.
- Finally, if you press the Export To Excel button a new workbook will be created and will contain all the results of the list box in order to be further processed (for reporting purposes).
Download it from here
Draw A Polyline In AutoCAD Using Excel VBA
AutoCAD – Calculate The Total Length Of Lines
AutoCAD – Total Length Of Lines Per Layer