List of intersection lines

List of intersection lines

Anonymous
Not applicable
1,811 Views
3 Replies
Message 1 of 4

List of intersection lines

Anonymous
Not applicable

Hello

 

I know that ı am able to find  a point where two lines are intersected eachother with this command '"object1.IntersectWith(IntersectObjects, ExtendOption)"

 

 

    Dim mainLine As AcadLine
Dim line1, line2,line3 As AcadLine

 

i have mainline information.  ı want find other lines which are intersected with the main line .

 

for example line1,line2 and line3 are intersected with main line,  ı want to find these lines.

 

 

Adsız.png

 

 

 

0 Likes
Accepted solutions (1)
1,812 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

 

 

you could

- collect all the lines but the main line in a selection set

- iterate through the selection set and store each line not intersecting with main line in an array

- use the not intersecting lines array to remove them from the selection set

- then you're left with a selection set of lines intersecting with the main line

0 Likes
Message 3 of 4

Anonymous
Not applicable

i find this code. this code very good working. but I do not understand the autolisp. How to write this code in vb.net / vba or C#.net

 
(vl-load-com)
(defun c:foo (/ e)
  (and (setq e (car (entsel "\Pick your line: ")))
       (= "LINE" (cdr (assoc 0 (entget e))))
       (sssetfirst
	 nil
	 (ssget "_F" (list (vlax-curve-getstartpoint e) (vlax-curve-getendpoint e)) '((0 . "line")))
       )
  )
  (princ)
)
 
 
0 Likes
Message 4 of 4

Anonymous
Not applicable
Accepted solution

see my answer here to a very same question

 

the code acts as I wrote in my post #2 with the exception of step 1 where it filters possible intersecting lines among those crossing the main line boundingbox 

0 Likes