Draw Largest Rectangle Possible Within Space

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey Guys,
I don't know if this can be done but I figured I would ask. I am looking for a lisp that will ask a user to select a closed polyline and then have it draw the largest rectangle possible within said closed shape. I need this new rectangle to also account for any existing line/layer/shape within said shape. Essentially I am looking to click the red layer in image 1 and then have the new rectangle pop up (layer black) in image 2 after it is done calculating everything and taking all other layers into account. I guess it's just a big if statement on setting the proposed rectangle to a set layer and then while drawing within the p-line it's set to avoid any intersection with any layer that is not the originally set one? I found some base code here https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-largest-rectangle-within-a-limi... but what it doesn't work on my end and even if it did it doesn't account for other layers/shapes/lines that could be within said p-line. Any assistance is much appreciated!