noyajr Posted January 29, 2023 Posted January 29, 2023 Hello everyone, i am asking if there is a lisp that could detect any clashes between blue polylines and magenta polylines and circles. If there is a clash blue polylines can change color to yellow for example just to be highlighted. You can fined the following screenshots as a reference and also dwg file attached. Thanks in advancenew block.dwg Quote
marko_ribar Posted January 29, 2023 Posted January 29, 2023 Are blue LINE(s) or POLYLINE(s)? If LINE(s), it's simple, but if not, then also account that magenta rectangles would change to yellow... Quote
noyajr Posted January 29, 2023 Author Posted January 29, 2023 1 minute ago, marko_ribar said: Are blue LINE(s) or POLYLINE(s)? If LINE(s), it's simple, but if not, then also account that magenta rectangles would change to yellow... the blue are actually polylines, anyway if the magenta would change to yellow no problem, but the magenta rectangles or circles should change to yellow Quote
marko_ribar Posted January 29, 2023 Posted January 29, 2023 (defun c:foo ( / ss i el e1x e2x ) (vl-load-com) (if (setq ss (ssget "_A" (list (cons 0 "*POLYLINE,CIRCLE")))) (repeat (setq i (sslength ss)) (setq el (cons (ssname ss (setq i (1- i))) el)) ) ) (foreach e1 el (setq el (vl-remove e1 el)) (foreach e2 el (if (vlax-invoke (vlax-ename->vla-object e1) (quote intersectwith) (vlax-ename->vla-object e2) acextendnone) (progn (entupd (cdr (assoc -1 (entmod (subst (cons 2 62) (assoc 62 (setq e1x (entget e1))) e1x))))) (entupd (cdr (assoc -1 (entmod (subst (cons 2 62) (assoc 62 (setq e2x (entget e2))) e2x))))) ) ) ) ) (princ) ) Untested, though, but should work... HTH. M.R. Quote
noyajr Posted January 29, 2023 Author Posted January 29, 2023 2 minutes ago, marko_ribar said: (defun c:foo ( / ss i el e1x e2x ) (vl-load-com) (if (setq ss (ssget "_A" (list (cons 0 "*POLYLINE,CIRCLE")))) (repeat (setq i (sslength ss)) (setq el (cons (ssname ss (setq i (1- i))) el)) ) ) (foreach e1 el (setq el (vl-remove e1 el)) (foreach e2 el (if (vlax-invoke (vlax-ename->vla-object e1) (quote intersectwith) (vlax-ename->vla-object e2) acextendnone) (progn (entupd (cdr (assoc -1 (entmod (subst (cons 2 62) (assoc 62 (setq e1x (entget e1))) e1x))))) (entupd (cdr (assoc -1 (entmod (subst (cons 2 62) (assoc 62 (setq e2x (entget e2))) e2x))))) ) ) ) ) (princ) ) Untested, though, but should work... HTH. M.R. Thank you for your work, but i tried it and it does nothing at all Quote
marko_ribar Posted January 29, 2023 Posted January 29, 2023 Maybe objects don't touch, for ex. - different elevations, but from TOP view they clash... Quote
noyajr Posted January 29, 2023 Author Posted January 29, 2023 5 minutes ago, marko_ribar said: Maybe objects don't touch, for ex. - different elevations, but from TOP view they clash... i made flatten to all objects, still nothing happens Quote
marko_ribar Posted January 29, 2023 Posted January 29, 2023 1 minute ago, noyajr said: i made flatten to all objects, still nothing happens I have no further conclusions... I strongly believe that the code is good, but in your comments I see that it's not what's expected... So long from me... M.R. Quote
noyajr Posted January 29, 2023 Author Posted January 29, 2023 4 hours ago, marko_ribar said: I have no further conclusions... I strongly believe that the code is good, but in your comments I see that it's not what's expected... So long from me... M.R. No worries, thanks for your help Quote
BIGAL Posted January 29, 2023 Posted January 29, 2023 An alternative is to use (ssget "F" points where the points are the polyline points it will find any object that touches say the blue pline, only gotcha is must check for the blue pline in the selection set returned and disregard. Will try to find something. 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.