Jump to content

Recommended Posts

Posted

Find out the intersection point of multiple objects. Please refer to the attached DWG file

intersection.dwg

Posted (edited)

Hi

Lines/polylines OB0, OB1, OB2 and OB3 intersect several different lines/polylines.
What is the criterion for determining which ones are important?
Or... Are they all important?

Edited by GLAVCVS
  • Thanks 1
Posted

Hi GLAVCVS,

All intersection points are required, but suggest some tricks  

 

 

Posted (edited)
(alert "MAAHEE: Insufficient arguments:
Please try again....") 

 

🙃

Edited by GLAVCVS
  • Funny 1
Posted

Automatic selection of what you show in your example drawing is not possible best I can tell, because seems to me, no common theme in what intersections you want.

 

Somewhat easy if selecting the lines/polylines or adding some sort of criteria to thin the herd.

 

Next problem, what exactly do you want to do with the intersection information? 

Posted

This will find points along a line. But note finds points also at start and end of line as they touch another object. There are ways to remove the end points. If dwgs are say horizontally inclined then could sort on X so dont use 1st and last.

 

(defun c:wow ( / )
(setq obj (vlax-ename->vla-object (car (entsel "\nPick line "))))
(setq hand (vlax-get obj 'handle))
(setq pts (list (vlax-curve-getstartPoint obj)
(vlax-curve-getendPoint obj))
)
(setq ss (ssget "F" pts (list (cons 0 "*line"))))
(setq ptsint '())
(repeat (setq x (sslength ss))
 (setq obj2 (vlax-ename->vla-object (ssname ss (setq x (1- x)))))
 (if (= (vlax-get obj2 'handle) hand)
  (princ "skip")
  (progn
  (setq intpts (vlax-invoke obj 'intersectwith obj2 acextendnone))
  (command "point" intpts)
  (setq ptsint (cons intpts ptsint))
  )
 )
)
(setq ptsint (reverse ptints))
(princ ptsint)
(princ)
)
(c:wow)

 

Like others need what is end goal.

  • Thanks 1
Posted (edited)

Bigal sir,

Nicely, work code, smarter way to find the intersection point, thanks................................

(setq ss (ssget "F" pts (list (cons 0 "*line") (cons 0 "lwp*"))))

But it cannot find the polyline intersection point.

Edited by maahee
Posted

Ok I think I understand will redo picking multi lines then look for intersections the reverse to the way I did it.

 

Note the 3rd intersection will be found as it crosses the rectang twice.

image.png.7bc73b3d4a733b79a6eb2e5a1ea5d085.png

  • Agree 1
Posted (edited)
14 hours ago, BIGAL said:

Ok I think I understand will redo picking multi lines then look for intersections the reverse to the way I did it.

 

Note the 3rd intersection will be found as it crosses the rectang twice.

image.png.7bc73b3d4a733b79a6eb2e5a1ea5d085.png

thank, 

Edited by maahee

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...