Jump to content

Lisp for Adding and Subtracting Polyline Areas


Recommended Posts

Posted

test.dwgIn the example attatched I want to take the Green polyline square footage, and subtract the magenta polyline square footage.

There are always just one 'green' polyline, but there could be one, or multiple, 'magenta' polylines.  I then need that number, in square feet, to populate the RMAREA portion of the attribute attached to the Usable Square Footage block.

Thank you for looking at this.

  • Replies 27
  • Created
  • Last Reply

Top Posters In This Topic

  • justin.grant

    6

  • Tharwat

    5

  • Dynaformer

    5

  • BIGAL

    4

Posted (edited)

Took me like 10 seconds to get answer. You isolate the layers green and magenta, then do a bpoly. Pick inside, just did a List and picked the outer new PLINE 

 

Green = 479812

Inside Green = 462049

 

image.png.13802bcbc565c8646ea90b98832906d1.png

 

I did something recently where I just got all the new bpoly's and compared the area so largest is answer. So it can be semi automated.

 

Do you have magenta plines inside ? If so could do a pick subtract object.

 

I will try to find again may have been here I don't save every lisp I do as have thousands. 

 

Edited by BIGAL
Posted

Not using code, turn the objects into regions then subtract the small areas from the large one.

Posted

Thank you BIGAL and ronjonp, but this isn't quite what I need.  I'd like the total square footage, Green - Magenta, and have the total saved in the attribute of the block that I select.

Lee Mac posted one 4 years ago that almost gets me there, 

, but it would only adds polylines and doesn't give an option to subtract.

Posted (edited)

That was what I proposed the code that I posted somewhere works out the area of the new Bpoly's and compares them to work out largest, so then just put area into a block attribute, again I will try to find, it was not that long ago. Start searching BIGAL area lisp autocad.

Edited by BIGAL
  • 2 weeks later...
Posted

Thank you mhupp and BIGAL.
 I'm still unable to figure out a solution.  I'm not a LISP coder, so I can't get it right :(

A quick recap, I have a single polyline around the exterior of a building floor, and multiple polylines inside that polyline, representing stairs, restrooms, additional core space, that I want excluded from the exterior area.  Example is in my post from above.

As stated above, Lee Mac almost gets me there, I just need the option to remove interior polyline areas from the exterior polyline area.
  Thanks again for the help.

Posted

Also pBe's lisp from above works great.   If it could put the total area, in sq ft, in an existing attribute, that would also work.

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...