Intersecting point of Arc and Line at different elevations - Best of Both Worlds

Intersecting point of Arc and Line at different elevations - Best of Both Worlds

CodeDing
Advisor Advisor
1,284 Views
2 Replies
Message 1 of 3

Intersecting point of Arc and Line at different elevations - Best of Both Worlds

CodeDing
Advisor
Advisor

This might be a bit much but I figured it might be worth a shot!

- I have 2 functions

--- one for intersecting LINES at DIFFERENT ELEVATIONS (I'll post my code, YES, it could probably be more sophisticated. I'm learning; love any feedback!)

--- one for intersecting LINES/ARCS at SAME ELEVATION (created by Lee Mac Here >>>LINK<<<)

- Is there a way to combine these two functions to make ONE ULTIMATE INTERSECTING FUNCTION?

...or would I be stuck having to determine the lines/elevations first then pick a function based off of my criteria?

 

Looking forward to the challenge!!! Best,

 

~DD

 

(defun C:EZINT (/ MyEnt iPoint SP1 EP1 SP2 EP2)
;;;;;find intersecting point of two lines, regardless of their z elevations
(vl-load-com)
(setq MyEnt (entsel "\nLine 1: "))
(setq SP1 (list (car (vlax-curve-getStartPoint (car MyEnt))) (cadr (vlax-curve-getStartPoint (car MyEnt))))
      EP1 (list (car (vlax-curve-getEndPoint (car MyEnt))) (cadr (vlax-curve-getEndPoint (car MyEnt)))))
(setq MyEnt (entsel "\nLine 2: "))
(setq SP2 (list (car (vlax-curve-getStartPoint (car MyEnt))) (cadr (vlax-curve-getStartPoint (car MyEnt))))
      EP2 (list (car (vlax-curve-getEndPoint (car MyEnt))) (cadr (vlax-curve-getEndPoint (car MyEnt)))))
(setq iPoint (inters SP1 EP1 SP2 EP2))

);defun
0 Likes
Accepted solutions (1)
1,285 Views
2 Replies
Replies (2)
Message 2 of 3

Kent1Cooper
Consultant
Consultant
Accepted solution

Welcome to these Forums!

 

I hate to discourage you from working out some code, but can't you just use the native APParent-intersection Object Snap mode?  It also "sees" real intersections, so it will cover the same-elevation situation as well as the different-elevations situation [assuming in the latter case that you're looking at the drawing plane that the objects are drawn in or parallel to from straight above or straight below].

Kent Cooper, AIA
Message 3 of 3

CodeDing
Advisor
Advisor

Kent!

 

As I enjoy and completely understand the need to not code every little detail (there is such thing as too much!) The reason I asked is because I am using (entsel) to extract Object Data from one of the lines at the same time. But you're right, perhaps I can just next ask for the intersection point as a (getpoint) value. What's one more click anyways?  

 

Thank you for your opinion, and as usual.. your timely response.

 

[edit] I also just realized it has stated this as my first post. I changed my email recently ugh! I WAS about 6-7 posts deep already lol. Gotta earn that Level 2 back.

 

Best,

~DD

0 Likes