samifox Posted April 19, 2024 Posted April 19, 2024 hi i need a lisp to snap vertices onto each other. if you have a long line that consist of lots of segment and not all segments are perfectly snapped to each other ased on proximity and distance. there must be a lisp someone wrote for this. any idea? Quote
Abrasive Posted April 20, 2024 Posted April 20, 2024 @Lee Mac Wrote a "Chain Select" routine that works really well. https://www.lee-mac.com/chainsel.html I believe you could modify Line 29 to a different tolerance if needed. .... (setq fz 1e-8) ;; Point comparison tolerance" 1 Quote
samifox Posted April 20, 2024 Author Posted April 20, 2024 I've adjusted the FZ to 3 and ensured that the lines aren't spaced more than that. However, it didn't yield the desired outcome. Additionally, even if it does work, shouldn't it align ? not just select??" Quote
Abrasive Posted April 20, 2024 Posted April 20, 2024 I did forget to mention I added to the routine after line 121: ... (command "._PEDIT" "_M" s2 "" "_Y" "_J" "" "") Not sure if that routine will work with such a large gap. It's also not meant to align segments but to select and then connect. Quote
BIGAL Posted April 20, 2024 Posted April 20, 2024 Been discussed a few times joining miscloses. Did you google ? "snap vertices onto each other autocad lisp" Pretty sure over at Forums/autodesk there is an answer. Quote
Jonathan Handojo Posted April 21, 2024 Posted April 21, 2024 (edited) I do have something. However, this doesn't technically "move" the line, it simply extends and trims the line to meet at the intersections. Just don't enter a tolerance too big. After you run this command, then you can join them (or even confirm using the forementioned Chain Selection program by Lee-Mac. In the attached I tried NEATX for fun, but the result turned out ugly as hell. So I just recommend NEAT instead and then you specify the tolerance... of probably 5 to 10, if your objects aren't too far. I can't really guarantee that this will work to your expectation, but hopefully it should. Neaten.lsp Edited April 21, 2024 by Jonathan Handojo Quote
BIGAL Posted April 22, 2024 Posted April 22, 2024 Had a quick look and I think Kent Coopers suggestion was best that you move both ends to the midpoint of the 2 ends that are not touching. What quantities are we talking about in other post a figure of 70,000 was suggested at this level the lisp may crash as the list gets to big of end values. Did you try the pedit solution ? 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.