PJ01 Posted February 10, 2023 Posted February 10, 2023 Hello, if I have an irregular polygon with 'N' number of sides, is there any AutoCAD command that will locate any gaps between the segments of the polygon? Quote
ColinPearson Posted February 10, 2023 Posted February 10, 2023 I don't mean to sound like I'm talking down to you - not my intent AT ALL - but can I ask why not just select the polyline and look for two grip that are close together? I'm sure there's more than one reason this may not be an ideal solution (multiple/many gaps and you want something to handlethem all at once, gaps so small that it's had to discern the multiple endpoint grips, etc)... just asking Quote
PJ01 Posted February 10, 2023 Author Posted February 10, 2023 (edited) Thanks Colin, I am a newbie and will take any and all advice. Usually the gaps I have are very tiny, and cannot see grips that are close together. I have to take every point where two segments meet, and zoom right down into that intersection. All very time consuming and tedious, and it doesn't always show the gap if the gap is so small.. there is always one more zoom needed Hence my question, surely there must be a better way Edited February 10, 2023 by PJ01 Quote
ColinPearson Posted February 10, 2023 Posted February 10, 2023 I'm guessing there probably is a way. On the other hand, what leads to the gaps? Are you drawing just by trying to place the end of a new PLINE at the end of another one "by eye"? Are you using the Snaps so that the next PLINE you draw is geometrically starting from teh exact endpoint of the previous PLINE? 1 Quote
mhupp Posted February 10, 2023 Posted February 10, 2023 (edited) I would run the join command to make it a polyline. then this will add a circle to current layer at the start point of any open polyline selected. ;;----------------------------------------------------------------------;; ;; Marks Polyline start and end points (defun C:OP (/ mspace SS) (setq mspace (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))) (while (setq SS (ssget '((0 . "*POLYLINE") (70 . 0)))) (foreach poly (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (setq cir (vla-AddCircle mspace (vlax-curve-getstartpoint poly) 1)) ;change 1 to a radius you want. (vla-put-color cir 3) (setq cir (vla-AddCircle mspace (vlax-curve-getendpoint poly) 1)) (vla-put-color cir 1) ) ) (princ) ) Edited February 10, 2023 by mhupp 1 Quote
CyberAngel Posted February 10, 2023 Posted February 10, 2023 The best way to fix a gap is not to draw it in the first place. Is it possible to draw a polyline to represent your polygon? That way the nodes are guaranteed to close, especially if you use the Close option to finish it. 1 1 Quote
Steven P Posted February 11, 2023 Posted February 11, 2023 If it was me, and it is an occasional occurrence - sometimes happens - I'd break at a point then selecting either side of the break will select the part up to the gap, then you can fix the gap, join it all together. However it is only an occasional thing for me so I have never needed to do any more than that (most often if (ahem) "Someone else" draws a polyline to be hatched with a gap - but my drawings don't have a lot of hatching) 1 Quote
PJ01 Posted February 11, 2023 Author Posted February 11, 2023 (edited) Good thinking, thanks Steve, this approach makes sense.The only problem I see ( for me) is joining them all up again where I broke the lines Edited February 12, 2023 by PJ01 Quote
PJ01 Posted February 12, 2023 Author Posted February 12, 2023 That method of breaking the loop worked beautifully. Found the break immediately. Strange, because I was able to fill the polygon with HATCH, which to me indicated that there was no break! Many thanks Steven P 1 Quote
Warren E. Black Posted February 12, 2023 Posted February 12, 2023 If you are drawing it --- use Colin Perssons fool-proof SNAPS. 1 Quote
Steven P Posted February 12, 2023 Posted February 12, 2023 11 hours ago, PJ01 said: Good thinking, thanks Steve, this approach makes sense.The only problem I see ( for me) is joining them all up again where I broke the lines 'Join' comment or pedit (polyline edit) and use the option join (depends which version of CAD you are using when the join command was added) Quote
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.