srikanth_0126 Posted June 25 Posted June 25 (edited) Hi, i have multiple polylines in a series and block are placed on them. i want to select the polylines between two selected blocks. sample file is attached. Thanks, Srikanth select_between _two_blocks_sample.dwg Edited June 25 by srikanth_0126 Quote
EnM4st3r Posted June 25 Posted June 25 (edited) I first thought to go like this but then i saw that there are multiple polylines between the blocks. This works only if there is only one Polyline inbetween. ; testing to select objects that touch each of the selected blocks (defun c:selectTest123 (/ ss i bbx ents) (setq ss (ssget '((0 . "INSERT")))) (setq i 0) (while (< i (sslength ss)) (setq bbx (LM:blockboundingbox (vlax-ename->vla-object (ssname ss i)))) ; get the blocks boundingbox (setq ents (cons (LM:ss->ent ; selectionset to list (ssget "_C" (trans (car bbx) 0 1) (trans (caddr bbx) 0 1) '((0 . "LWPOLYLINE")); <----------- ssget filter ) ) ents ) ) (setq i (1+ i)) ) (setq ss (ssadd)) (setq ents (LM:ListsIntersection ents)) (if ents (sssetfirst nil (apply '(lambda (e) (ssadd e ss)) ents))) ) Used many functions of Lee Mac, the ones used are in the file attached used LM subfunctions.lsp Edited June 25 by EnM4st3r Quote
BIGAL Posted June 26 Posted June 26 If blocks are near a vertice or on a vertice helps, noticed block insertion point is not on a vertice in sample dwg. It may be feasible to get segments of a pline so between blk1 - blk2 is segments 5,6 & 7. Copy the pline you now have vertice points trim outside of the 2 block points, you now have a result a new pline, what now ? But that's about where I stop. I worry about the inaccuracies of the blocks not being on a vertice. Maybe provide a new sample dwg. Quote
srikanth_0126 Posted June 26 Author Posted June 26 (edited) Hi @BIGAL, blocks are placed between two parallel lines. other line is not in given sample file. i use the selection as for input another lisp to create a length of selected polylines. it maybe possible to use bounding box overlap method. right now i'm using fastsel and chainselection by @Lee Mac. but, chainslection is selecting everything it touches and fastsel doesn't have any control. what i'm assuming is with chainselection extending selection until it overlaps with a block. Edited June 26 by srikanth_0126 Quote
srikanth_0126 Posted June 27 Author Posted June 27 HI, @BIGAL i got this from this thread and its creates a new path between two and creates a new using traced polylines. i want select the traced polylines. is that possible with this code? 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.