Jump to content

Need a tool for creating 2d outlines for complex 2d drawings


Recommended Posts

Posted

Hi everyone,
Ankit here.

I’m currently looking for a reliable solution to generate 2D outer boundaries for complex drawings in AutoCAD. The solution should be:

Highly accurate (able to capture minute details)

Efficient in terms of performance (handling large/complex drawings smoothly)

Capable of working with imperfect geometry (small gaps, overlaps, etc.)

I’ve used tools like TotalBoundary earlier, but since it’s no longer purchasable/accessible, I’m exploring alternatives.

Does anyone know of any plugin, LISP, or workflow that can achieve similar or better results?

Any recommendations would be really helpful. Thanks in advance!

Posted

Here is something simple I threw together a while ago. Not everything you want, but should help.

 

I started a more extreme version with more options back when people were posting they couldn't get TotalBoundary and SuperBoundary any longer.

 

I'll try to get back on it this week, in the mean time, if you could post a drawing with some before and after it would help.

 

I have no idea what all TotalBoundary and SuperBoundary does, it may help to explain exactly how you need to select and exactly what should be a boundary in your drawing it might might it easier. 

 

Hopefully a better LISPer will jump in.

 

;;; Select objects that define outlines. Works on LINE/ARC/CIRCLE/SPLINE/LWPOLYLINE.
;;;
;;; https://www.cadtutor.net/forum/topic/99063-need-a-tool-for-creating-2d-outlines-for-complex-2d-drawings/#findComment-678789
;;; 
;;; By SLW210 (a.k.a. Steve Wilson)
;;;

;;; MakeOut.lsp

(defun c:MakeOut (/ ss i ent lst pts plines regions pp)
  (vl-load-com)
  (if (setq ss (ssget '((0 . "LINE,ARC,CIRCLE,SPLINE,LWPOLYLINE"))))
    (progn
      (setq i 0)
      (while (< i (sslength ss))
        (setq ent (ssname ss i))
        (setq i (1+ i))
      )
      (command "_.-boundary" ss "")
      (command "_.pedit" ss "" "J" "" "Y")
      (setq i 0)
      (while (< i (sslength ss))
        (setq ent (ssname ss i))
        (if (= (cdr (assoc 0 (entget ent))) "LWPOLYLINE")
          (progn
            (command "_.pedit" ent "" "S" "0.01" "")
            (command "_.pedit" ent "" "C" "")
          )
        )
        (setq i (1+ i))
      )
      (princ "\nOutline created.")
    )
    (princ "\nNo valid entities selected.")
  )
  (princ)
)

 

  • Like 1
Posted
43 minutes ago, SLW210 said:

Here is something simple I threw together a while ago. Not everything you want, but should help.

 

I started a more extreme version with more options back when people were posting they couldn't get TotalBoundary and SuperBoundary any longer.

 

I'll try to get back on it this week, in the mean time, if you could post a drawing with some before and after it would help.

 

I have no idea what all TotalBoundary and SuperBoundary does, it may help to explain exactly how you need to select and exactly what should be a boundary in your drawing it might might it easier. 

 

Hopefully a better LISPer will jump in.

 

;;; Select objects that define outlines. Works on LINE/ARC/CIRCLE/SPLINE/LWPOLYLINE.
;;;
;;; https://www.cadtutor.net/forum/topic/99063-need-a-tool-for-creating-2d-outlines-for-complex-2d-drawings/#findComment-678789
;;; 
;;; By SLW210 (a.k.a. Steve Wilson)
;;;

;;; MakeOut.lsp

(defun c:MakeOut (/ ss i ent lst pts plines regions pp)
  (vl-load-com)
  (if (setq ss (ssget '((0 . "LINE,ARC,CIRCLE,SPLINE,LWPOLYLINE"))))
    (progn
      (setq i 0)
      (while (< i (sslength ss))
        (setq ent (ssname ss i))
        (setq i (1+ i))
      )
      (command "_.-boundary" ss "")
      (command "_.pedit" ss "" "J" "" "Y")
      (setq i 0)
      (while (< i (sslength ss))
        (setq ent (ssname ss i))
        (if (= (cdr (assoc 0 (entget ent))) "LWPOLYLINE")
          (progn
            (command "_.pedit" ent "" "S" "0.01" "")
            (command "_.pedit" ent "" "C" "")
          )
        )
        (setq i (1+ i))
      )
      (princ "\nOutline created.")
    )
    (princ "\nNo valid entities selected.")
  )
  (princ)
)

 

Thanks for sharing this, really appreciate it.

 

I gave your LISP a try on a few drawings — it works quite well on cleaner geometry, so that was helpful.

In my case, I’m mostly dealing with drawings that have small gaps or slightly messy geometry, and that’s where I’m still seeing some inconsistencies with boundary creation.

 

Your point about sharing an example makes sense — I’ll put together a sample with before/after to better explain the issue.

I’ve also been experimenting with a slightly different approach for handling these kinds of cases, especially for more complex drawings. I’ll share a quick example once I clean it up a

bit.

Posted

I updated something that makes multiple boundaries but cant find the post right now. doesn't work with gaps so idk if its something you could use.

lee mac has an outline but also don't think it works with gaps. https://lee-mac.com/outlineobjects.html

  • Like 1
Posted
13 hours ago, mhupp said:

I updated something that makes multiple boundaries but cant find the post right now. doesn't work with gaps so idk if its something you could use.

lee mac has an outline but also don't think it works with gaps. https://lee-mac.com/outlineobjects.html

Thanks for pointing that out, that’s really helpful.

I’ve noticed similar behavior as well.

I took a look at the Lee Mac outline routine, and it seems to work fine for cleaner cases, but like you mentioned, it still struggles when there are small gaps or slightly messy geometry.

That’s been the main challenge on my end — most approaches seem to rely on boundary detection underneath, so they tend to break in those situations.

I’ll put together a sample to better show the kind of cases I’m dealing with and what I’ve been testing.

Posted

 

Here’s a sample of the kind of drawing I’m working with.

It has dense geometry with small gaps and overlapping elements, and in cases like this, standard boundary methods don’t always produce consistent results.

This is the type of scenario I’ve been trying to handle more reliably.

 

image.png.b6efa2f42a3434f47be7b1be0c78e821.png

 

I tried this on one of my actual project drawings.

The image shows the input geometry and the output generated using the suggested approach (blue lines indicate the generated boundaries).

It works quite well in simpler cases, but for this type of geometry I’m still seeing partial or inconsistent boundaries being created — it’s not forming a single clean outer boundary for the full shape.

This is the kind of scenario I’ve been struggling with, especially where there are small gaps or more complex connections.

 

image.png.6cff1764e1197371f5c16c8a787fc4ad.png

  • Thanks 1
Posted

I had to stop on the newer version yesterday due to my "paid" for work, still debugging it.

 

Can you post an actual .dwg of that example for testing?

 

Also, what version of AutoCAD are you using?

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...