jomer Posted September 14, 2018 Share Posted September 14, 2018 (edited) Hi all! i need a VBA code for calculating area of a specific layer i have a code for calculating an area but it just computing the whole objects and polyline in the model space Your help will be really much appreciated Best Regards, Jomer Edited September 14, 2018 by jomer Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 18, 2018 Share Posted September 18, 2018 Are you asking for a boundary area of the 1layer , not individual objects ? If this is the case there are just so many different ways of interpreting the answer depending on the interactivity of the shapes involved. Quote Link to comment Share on other sites More sharing options...
jomer Posted September 19, 2018 Author Share Posted September 19, 2018 (edited) Thank you for your concern sir Yes sir, i'm referring to the area of 1 layer, not individual objects This is the code i get in computing the area but for the whole model space Public Function GetTotalPolylineArea() As Double Dim area As Double Dim ent As AcadEntity Dim pl As AcadLWPolyline For Each ent In ThisDrawing.ModelSpace If TypeOf ent Is AcadLWPolyline Then Set pl = ent area = area + pl.area End If Next GetTotalPolylineArea = area End Function Sir i have list of layers in combobox The problem is how can i get the area of the layer i choose in that combobox Thank you sir in advance Edited September 19, 2018 by jomer Quote Link to comment Share on other sites More sharing options...
goran Posted October 12, 2018 Share Posted October 12, 2018 'Im referring to the area of 1 layer, not individual objects ' Layer as layer doesn't have area, but you can calculate area of elements on layer, but again, not for all. Point, text doesn't have area. Layer is just property of any object, just as collor (entity is word we usualy use) Quote Link to comment Share on other sites More sharing options...
goran Posted October 12, 2018 Share Posted October 12, 2018 Ops, old post, sorry:-) Quote Link to comment Share on other sites More sharing options...
Cleyton Ramos Posted November 2, 2018 Share Posted November 2, 2018 You can identify each polyline through the layer and select it and extract the area. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.