How to automatically calculate area of multiple closed polylines?

How to automatically calculate area of multiple closed polylines?

knuwan
Enthusiast Enthusiast
21,644 Views
48 Replies
Message 1 of 49

How to automatically calculate area of multiple closed polylines?

knuwan
Enthusiast
Enthusiast

I have this hundreds of closed polylines in different layers.Now I want to calculate the total area for each object/layer type.I would be nice if I have a dynamic table containing the data.

* I dont want to use "Area" cmd and select each PL

*I dont want to create parcels.

 

Any suggestions?

Thanks.

Accepted solutions (3)
21,645 Views
48 Replies
Replies (48)
Message 2 of 49

pendean
Community Legend
Community Legend
While you wait...
There are quite a few LISP routines here to explore http://www.lee-mac.com/programs.html
and quite a few apps here to explore as well https://apps.autodesk.com/ACD/en/Home/Index

HTH
0 Likes
Message 3 of 49

AllenJessup
Mentor
Mentor

You can look HERE

Otherwise. Create your table and insert a Field in each cell. Link a field to each polyline. That will make it dynamic.

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 4 of 49

ecfernandez
Mentor
Mentor

Hi @knuwan, you can use Dynamo for Civil 3D.

 

@samir_rezk is way ahead of us on that topic. Look at one of his classes where he explains something similar.

 

AUniversity: Getting Started with Dynamo for Civil 3D: A Beginner’s Guide 

 

My regards!

 

Camilo Fernández

Civil engineer | Specialist in design, construction, and maintenance of roadways

EESignature

LinkedIn
0 Likes
Message 5 of 49

Joe-Bouza
Mentor
Mentor
Accepted solution

DATAEXTRACTION

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 6 of 49

Joe-Bouza
Mentor
Mentor

Hi Allen 

Dataextration will do that - no touch 😎

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 7 of 49

ChicagoLooper
Mentor
Mentor

Assuming you have already found a way to create a TABLE, the issue you are overlooking is how to identify each parcel in your table. For example, if you have a total of 42 parcels, then how does your table relate each area with a specific parcel? You will undoubtedly get 42 numbers indicating the 42 'areas' but how will you correlate each number to each parcel?

 

Identifying each parcel is critical to your workflow. 

Chicagolooper

EESignature

0 Likes
Message 8 of 49

knuwan
Enthusiast
Enthusiast

In Dataextraction it asks me to select the objects that I need to calculate.so it only take what I selected.

I need something that detects the layers(check the scr shot) If I add more items later it should get into the table automatically.(perhaps I'm crazy)

 

0 Likes
Message 9 of 49

AllenJessup
Mentor
Mentor

Good morning Joe,

 

Using DATAEXTRACTION. How would you make the table Dynamic. Would you have to do another extraction after any edits?

There are other tricks like creating Regions from the polylines and using Union and Subtract. I used to do that to dynamically show impervious area in a Bulk Table.

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 10 of 49

knuwan
Enthusiast
Enthusiast

In your "field" method,I need to select them one by one right?

Cant I just get the calculation according to the Layer name just selecting the Layer name just like I use "qselect"? 

0 Likes
Message 11 of 49

AllenJessup
Mentor
Mentor

@knuwan 

 

Not crazy. But for all that. I think you would need a customized routine. Either Lisp or some higher language. 

Or possibly DYNAMO .

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 12 of 49

AllenJessup
Mentor
Mentor

@knuwan wrote:

Cant I just get the calculation according to the Layer name just selecting the Layer name just like I use "qselect"? 


No. Unfortunately it has to be one by one. Each Field must be linked to a specific polyline.

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 13 of 49

RonaldBrañez
Advocate
Advocate

_dataextraction command
1 create a new data file

de1.PNG

 

Look for the folder where it will be saved and assign it a name (when you want to modify your data you can select the same file)

2 select the dwg file from which you want to extract data

 

de2.PNG


3 select the objects from which you want to extract data

de3.PNG

4. Filter the category and the properties you want to extract

de4.PNG

5 you can sort the table, combine, rename columns and even create custom columns

de5.PNG


6 finally, select how you want the data to be extargeted

de6.PNG

Message 14 of 49

ChicagoLooper
Mentor
Mentor

You can do this without using code.

 

If you are open minded you can do it by exporting to shapefile. During the MAPEXPORT procedure, you'll grab one or some 'properties' from each parcel. The properties you grab will be consistent with the numbers you see in the Properties Palette. Of particular interest is the property AREA which is the property you want. You can consider the properties you grab during MAPEXPORT to be data associated to each individual parcel. Data that's associated with each parcel makes your parcels smart objects.

 

<<It's like your cell phone. You can own a dumb phone that can only perform talk and text or you can have a smart phone capable of giving you verbal driving directions, perform online banking, connect with bluetooth, use apps and much, much more. Smart phones beat dumb phones and smart parcels always beat dumb parcels.>>

   

Switch from Civil3D workspace to Planning & Analysis workspace so you'll have access to the Map3D toolset where you can work with and bring in shapefiles. Once the shapefile is in your drawing you can add 'area' labels to each individual parcel. While still in Planning & Analysis workspace you can 'convert' the shapefile parcel labels into regular, plain vanilla AutoCad mtext (use MAPLABEL2ANN to do this). And once converted you can disconnect or turn off the shapefile leaving just the mtext entities. Simply cut-and-paste the mtext to your original drawing. 

 

<<When a shapefile is in your drawing, the shapefile's Table View will display the data in rows and columns that you may cut-and-paste to a spreadsheet.  In addition to labeling each parcel with Area you can, if you wish, add a Feature ID label adjacent to each Area. The FeatID, which serves as a unique identifier, is automatically created during the MapExport procedure and like all data, will appear in its own column in the Table View.>>

Chicagolooper

EESignature

Message 15 of 49

ChicagoLooper
Mentor
Mentor

DATAEXTRACTION command will work by giving you the area for each polygon or parcel. What it won't do is tell you which area goes with each individual parcel. For example, if you have 50 parcels and get 50 'areas' the table won't indicate that Area 12 goes with Parcel 12 because the area values are not associated with their polygonal objects. If all you want is 50 areas arranged in rows and columns, then DATAEXTRACTION is for you. But if you want 50 individual 'areas' with each area corresponding a an individual identifiable parcel then DataExtraction will fall short.  

Chicagolooper

EESignature

Message 16 of 49

jeff_rivers
Advisor
Advisor

This is where Fields and Data extraction really fall on their face.  Sorry AutoDesk, but this is a huge QC nightmare.  Once a field or a data extraction is created there is no way to later identify what source object(s) the fields or data extractions are connected to.  

 

When I am working on a cost estimate, I absolutely cannot trust a number that appears in the drawing if there is no way to positively connect that number to the source.  


Jeffrey Rivers
Win 10 Pro 64-bit, Intel i9 3.7GHz, 64 GB
NVIDIA RTX A4000
C3D 2020 V13.2.89.0
Message 17 of 49

jae.kwon
Collaborator
Collaborator

I put together a Dynamo solution you can try.

 

Output has:

  • total area for each layer that has closed polylines
  • area of each polyline with a reference to the handle of the "parent parcel" layer.
    • You designate a layer as the polyline layer that contains the parcels that all sub-areas are contained in.
    • I know object handles are not that readable but without knowing how you ID each lot, this was the only solution I had at hand
    • ObjectID is also included in the output but it isn't used.

Usage:

 

  1. Open PolylineAreas.dwg.
  2. Delete all objects in this drawing and copy in your closed polylines.
  3. Select all closed polylines and add the property set "Area ID"
  4. Open Dynamo Player and select PolylineAreas.dyn.
  5. Edit the inputs (output csv name and the parent parcel polyline layer name)
  6. Run the script and inspect the output csv.
Message 18 of 49

Joe-Bouza
Mentor
Mentor

At firs look it may seem that way. You all choose the current drawing or Evan a list of drawings then you can filter by layer and or many other attributes in the drawing

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 19 of 49

Joe-Bouza
Mentor
Mentor

The table are dynamic you can set the system variable to refresh in a multiple of was or right click update. There are options. 

 

Also choosing current drawing or list of drawings and using the DE filters you sided step the deletion set limitation 

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 20 of 49

Joe-Bouza
Mentor
Mentor

Go back to my response. DE is very robust 

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes