<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: normal intersection in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845871#M167196</link>
    <description>&lt;P&gt;Projection...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:foo nil
  
  (setq e1 (Car (entsel "1: ")))
  (setq e2 (car (entsel "2: ")))
  (setq p (getpoint "point on 1: "))
  
  (setq d (vlax-curve-getfirstderiv e1 (vlax-curve-getparamatpoint e1 p)))
  (setq n (list (- (cadr d)) (car d) 0))
  
  (command "_point" "_non" (vlax-curve-getclosestpointtoprojection e2 p n t))
  
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Oct 2025 20:46:33 GMT</pubDate>
    <dc:creator>ВeekeeCZ</dc:creator>
    <dc:date>2025-10-09T20:46:33Z</dc:date>
    <item>
      <title>normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845006#M167165</link>
      <description>&lt;P&gt;I'd like to find the intersection of a normal FROM a reference line and not TO a secondary line. &lt;STRONG&gt;(vlax-curve-getClosestPointTo ent2 pt)&lt;/STRONG&gt; returns the normal to obj2 from pt &lt;EM&gt;(grey in the attached image)&lt;/EM&gt;, but I want the red coordinate.&lt;BR /&gt;I could offset a line from ent1 then use&amp;nbsp;&lt;STRONG&gt;(vlax-curve-getClosestPointTo ent3 pt)&lt;/STRONG&gt;&amp;nbsp;to create the dashed red line then use &lt;STRONG&gt;(vla-IntersectWith ent2 ent4)&lt;/STRONG&gt; but if there's a quicker method I'd rather use that.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 12:27:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845006#M167165</guid>
      <dc:creator>scott_bolton</dc:creator>
      <dc:date>2025-10-09T12:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845039#M167166</link>
      <description>&lt;P&gt;Both are actual LINEs? If so, use (inters) func.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 12:54:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845039#M167166</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2025-10-09T12:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845120#M167168</link>
      <description>&lt;P&gt;I think Lee Mac might have some helpers for vectors, Assuming the lines are planar, you will want to:&lt;/P&gt;&lt;P&gt;- &amp;nbsp;find the direction of the line as a vector, or angle so you can use polar point&lt;/P&gt;&lt;P&gt;-&amp;nbsp; create a ray or xline perpendicular to the line&lt;/P&gt;&lt;P&gt;- find the intersection of the ray/xline with your target line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proof of concept&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from pyrx import Db, Ed, Ge, Ap, Rx, Gs

@Ap.Command()
def doit():
    try:
        ps1, id1, pnt1 = Ed.Editor.entSel("\nSelect 1: ", Db.Curve.desc())
        ps2, id2, pnt2 = Ed.Editor.entSel("\nSelect 2: ", Db.Curve.desc())

        c1 = Db.Curve(id1)
        c2 = Db.Curve(id2)

        dir1 = c1.getPointAtParam(0) - c1.getPointAtParam(c1.getEndParam())
        geline = Ge.Line3d(pnt1, dir1.perpVector())

        gec2 = c2.getAcGeCurve()
        if not gec2.isKindOf(Ge.EntityId.kLinearEnt3d):
            raise RuntimeError("oof not a kLinearEnt3d")

        flag, inters = geline.intersectWith(Ge.LinearEnt3d.cast(gec2))
        if flag:
            Ed.Core.grDraw(pnt1, inters, 1, 0)
    except Exception as err:
        print(err)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="inter.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1577573iF089B1DF9B15F639/image-size/medium?v=v2&amp;amp;px=400" role="button" title="inter.png" alt="inter.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 13:27:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845120#M167168</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2025-10-09T13:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845158#M167169</link>
      <description>&lt;P&gt;try this one&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(setq this_point (vlax-curve-getclosestpointtoprojection (car (entsel "\nPick ent2: ")) (getpoint "\nPick point pt: ") '(0 1 0)))&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Oct 2025 13:47:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845158#M167169</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2025-10-09T13:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845194#M167170</link>
      <description>&lt;P&gt;If you are in 2D - here's the basic code example to do what you want for lines or polylines:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:foo (/ a e1 e2 et1 et2 ep1 ep2 g1 g2 n1 p1 p2 pp o1 o2 sp1 sp2)
   (if
     (and
        (setq g1 (entsel "\nSelect first line: "))
        (setq g2 (entsel "\nSelect second line: "))
     )
     (progn
         (setq p1  (cadr g1) p2 (cadr g2)
               e1  (car  g1) e2 (car  g2)
               et1 (cdr (assoc 0 (entget e1)))
               et2 (cdr (assoc 0 (entget e2)))
               o1  (vlax-ename-&amp;gt;vla-object e1)
               o2  (vlax-ename-&amp;gt;vla-object e2)
               p1  (vlax-curve-getclosestpointto o1 p1)
               p2  (vlax-curve-getclosestpointto o2 p2)
         )
         (cond
            ((= et1 "LINE")
               (setq sp1 (vlax-curve-Getstartpoint o1)
                     ep1 (vlax-curve-Getendpoint   o1) 
               )
            )
            ((= et1 "LWPOLYLINE")
               (setq pp  (vlax-curve-getparamatpoint o1 p1)
                     sp1 (vlax-curve-getpointatparam o1 (fix pp))
                     ep1 (vlax-curve-getpointatparam o1 (1+ (fix pp)))
               )
            )
         )
         (setq a1  (angle sp1 ep1)
               n1  (polar p1 (+ a1 (/ pi 2)) 1)
         )
         (cond
            ((= et2 "LINE")
               (setq sp2 (vlax-curve-Getstartpoint o2)
                     ep2 (vlax-curve-Getendpoint   o2) 
               )
            )
            ((= et2 "LWPOLYLINE")
               (setq pp  (vlax-curve-getparamatpoint o2 p2)
                     sp2 (vlax-curve-getpointatparam o2 (fix pp))
                     ep2 (vlax-curve-getpointatparam o2 (1+ (fix pp)))
               )
            )
         )
         (if (setq p3 (inters p1 n1 sp2 ep2 nil))
            (command "._line" "_non" p1 "_non" p3)
         )
      )
   )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 13:59:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845194#M167170</guid>
      <dc:creator>pkenewell6347</dc:creator>
      <dc:date>2025-10-09T13:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845235#M167172</link>
      <description>&lt;P&gt;The following will work in 3D but assumes that the two line lie in the same plane.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:project2line ( / line1 line2 ent1 ent2 normal pt p1 p2 p3 p4 p5 p6 )
; projects a point from line 1 to line 2 
  (vl-load-com) ; Load Visual LISP extensions

  ; Prompt user to select the first line
  (setq line1 (entsel "\nSelect the first line: "))
  (if line1
    (progn
      (setq ent1 (car line1)) 
      (if (= (cdr (assoc 0 (entget ent1))) "LINE") ; Check if it's a LINE entity
        (progn
          (setq obj1 (vlax-ename-&amp;gt;vla-object ent1)) ; Convert entity name to VLA-object
          (setq p1 (vlax-safearray-&amp;gt;list (vlax-variant-value (vla-get-startpoint obj1))))
          (setq p2 (vlax-safearray-&amp;gt;list (vlax-variant-value (vla-get-endpoint obj1))))
        )
        (princ "\nSelected entity is not a line.")
      )
    )
    (princ "\nNo first line selected.")
  )
  (setq line2 (entsel "\nSelect the second line: "))
  (if line2
    (progn
      (setq ent2 (car line2)) 
      (if (= (cdr (assoc 0 (entget ent2))) "LINE") ; Check if it's a LINE entity
        (progn
          (setq obj2 (vlax-ename-&amp;gt;vla-object ent2)) ; Convert entity name to VLA-object
          (setq p3 (vlax-safearray-&amp;gt;list (vlax-variant-value (vla-get-startpoint obj2))))
          (setq p4 (vlax-safearray-&amp;gt;list (vlax-variant-value (vla-get-endpoint obj2))))
        )
        (princ "\nSelected entity is not a line.")
      )
    )
    (princ "\nNo second line selected.")
  )
(setq pt (getpoint "\nIdentify point on LINE 1 to project to LINE 2. "))
(setq normal (cross (mapcar '- p2 pt) (mapcar '- pt p3)))
  (setq p5 (mapcar '+ pt (cross normal (mapcar '- p2 pt))))
  (setq p6 (inters p3 p4 pt p5 nil))
  ;(command "_point" "_non" p6)
(command "_line" "_non" pt "_non" p6 "")
  (princ) 
)

;;; Compute the cross product of vectors a and b
(defun cross (a b / crs)
  (setq	crs (list
	      (- (* (nth 1 a) (nth 2 b))
		 (* (nth 1 b) (nth 2 a))
	      )
	      (- (* (nth 0 b) (nth 2 a))
		 (* (nth 0 a) (nth 2 b))
	      )
	      (- (* (nth 0 a) (nth 1 b))
		 (* (nth 0 b) (nth 1 a))
	      )
	    )				;end list
  )					;end setq c
)					;end cross&lt;/LI-CODE&gt;&lt;P&gt;[Code edited 10/9/2025 to add line instead of point and change program name]&lt;/P&gt;&lt;P&gt;l&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 15:22:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845235#M167172</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2025-10-09T15:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845316#M167176</link>
      <description>&lt;P&gt;Please try it&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:vert-line (/ AUX-LINE G2 PT1 PT@G2 PTAUX XYZ@G2 )
    (setq pt1 (cadr (entsel "\nSelect Point at  first line: ")))
  (setq g2 (entsel "\nSelect second line: "))
  (setq ptaux (polar pt1 (* 0.5 pi) 10))
  (command "_line" pt1 ptaux "")
  (setq aux-line (entlast))
  (setq	pt@g2 (VLA-INTERSECTWITH
		(VLAX-ENAME-&amp;gt;VLA-OBJECT aux-line)
		(VLAX-ENAME-&amp;gt;VLA-OBJECT (car g2))
		1
	      ) ;_ end of VLA-INTERSECTWITH
  ) ;_ end of setq
  (Setq xyz@g2 (VLAX-SAFEARRAY-&amp;gt;LIST (VLAX-VARIANT-VALUE pt@g2)))
  (command "line" pt1 xyz@g2 "")
  (command "erase" aux-line "")
) ;_ end of defun
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Oct 2025 15:02:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845316#M167176</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2025-10-09T15:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845627#M167182</link>
      <description>&lt;P&gt;They could be LINEs or LWPOLYLINEs with arc elements so inters won't work, and this is where a couple of the ones below fail.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 18:03:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845627#M167182</guid>
      <dc:creator>scott_bolton</dc:creator>
      <dc:date>2025-10-09T18:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845628#M167183</link>
      <description>&lt;P&gt;This isn't LISP so is beyond me; I'm not able to see if it works or not.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 18:04:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845628#M167183</guid>
      <dc:creator>scott_bolton</dc:creator>
      <dc:date>2025-10-09T18:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845633#M167184</link>
      <description>&lt;P&gt;This works for straight&amp;nbsp;&lt;SPAN&gt;LINEs or LWPOLYLINEs but not if the LWP contains arcs.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 18:06:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845633#M167184</guid>
      <dc:creator>scott_bolton</dc:creator>
      <dc:date>2025-10-09T18:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845634#M167185</link>
      <description>&lt;P&gt;&lt;SPAN&gt;This works for straight&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;LINEs or LWPOLYLINEs but not if the LWP contains arcs.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 18:06:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845634#M167185</guid>
      <dc:creator>scott_bolton</dc:creator>
      <dc:date>2025-10-09T18:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845637#M167186</link>
      <description>&lt;P&gt;I haven't checked this because I notice it creates a temporary LINE which I was hoping to avoid. However, it looks like this is the (only) way to do it.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 18:08:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845637#M167186</guid>
      <dc:creator>scott_bolton</dc:creator>
      <dc:date>2025-10-09T18:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845674#M167188</link>
      <description>&lt;P&gt;If a temporary Line is to be drawn anyway, you could try my&lt;FONT face="courier new,courier" size="4"&gt;&lt;STRONG&gt; (pf)&lt;/STRONG&gt; &lt;/FONT&gt;[= &lt;FONT face="courier new,courier" size="4"&gt;&lt;STRONG&gt;p&lt;/STRONG&gt;&lt;/FONT&gt;erpendicular &lt;FONT face="courier new,courier" size="4"&gt;&lt;STRONG&gt;f&lt;/STRONG&gt;&lt;/FONT&gt;rom] function, &lt;A href="https://forums.autodesk.com/t5/autocad-forum/drawing-a-perpendicular-line-from-a-point-on-the-line/m-p/12849927/highlight/true#M252707" target="_blank" rel="noopener"&gt;&amp;gt;here&amp;lt;&lt;/A&gt;.&amp;nbsp; See the description at Message 6 of that topic, but don't use the code there -- use the code attached at the linked Message.&lt;/P&gt;
&lt;P&gt;It works to draw something like a Line [or as a Move or Copy displacement, or...] &lt;FONT face="courier new,courier" size="4"&gt;&lt;STRONG&gt;p&lt;/STRONG&gt;&lt;/FONT&gt;erpendicular &lt;FONT face="courier new,courier" size="4"&gt;&lt;STRONG&gt;f&lt;/STRONG&gt;&lt;/FONT&gt;rom &lt;STRONG&gt;&lt;EM&gt;anything with linearity&lt;/EM&gt;&lt;/STRONG&gt; -- Line, Polyline [including arc segments], Circle, Arc, Ellipse, Spline, Ray, or Xline.&amp;nbsp; If you use it to draw a Line, just draw it past the other object, and take the intersection.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2025 12:22:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845674#M167188</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2025-10-10T12:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845687#M167189</link>
      <description>&lt;P&gt;FWIW: Here's a new version of my code that uses a temp line and (vla-intersectwith):&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:foo (/ a doc e1 e2 et1 ep1 g1 g2 n1 p1 p2 p3 pp o1 o2 sp1 spc)
   (vl-load-com)
   (setq doc (vla-get-activedocument (vlax-get-acad-object))
         spc (if (&amp;gt; (getvar "CVPORT") 1)(vla-get-modelspace doc)(vla-get-paperspace doc))
   )
   (if
     (and
        (setq g1 (entsel "\nSelect first line: "))
        (setq g2 (entsel "\nSelect second line: "))
     )
     (progn
         (setq p1  (cadr g1) p2 (cadr g2)
               e1  (car  g1) e2 (car  g2)
               et1 (cdr (assoc 0 (entget e1)))
               o1  (vlax-ename-&amp;gt;vla-object e1)
               o2  (vlax-ename-&amp;gt;vla-object e2)
               p1  (vlax-curve-getclosestpointto o1 p1)
         )
         (cond
            ((= et1 "LINE")
               (setq sp1 (vlax-curve-Getstartpoint o1)
                     ep1 (vlax-curve-Getendpoint   o1) 
               )
            )
            ((= et1 "LWPOLYLINE")
               (setq pp  (vlax-curve-getparamatpoint o1 p1)
                     sp1 (vlax-curve-getpointatparam o1 (fix pp))
                     ep1 (vlax-curve-getpointatparam o1 (1+ (fix pp)))
               )
            )
         )
         (setq a1 (angle sp1 ep1)
               n1 (polar p1 (+ a1 (/ pi 2)) 1)
               o3 (vla-addline spc (vlax-3d-point p1) (vlax-3d-point n1))
         )
         (if (setq p3 (vlax-safearray-&amp;gt;list (vlax-variant-value (vla-intersectwith o3 o2 acExtendBoth))))
            (vla-addline spc (vlax-3d-point p1) (vlax-3d-point p3))
         )
         (vla-delete o3)
      )
   )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Oct 2025 18:48:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845687#M167189</guid>
      <dc:creator>pkenewell6347</dc:creator>
      <dc:date>2025-10-09T18:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845735#M167190</link>
      <description>&lt;P&gt;Try this code...&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun c:Int(/)     
    (command
      "_point"
      "_non"
      (vlax-curve-getClosestPointToProjection (car (entsel "\nSelect Object 2"))
                                              (getpoint "\nPick Point: ")
                                              '(0 -1 0)
                                              t
      )
    )
     )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 19:17:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845735#M167190</guid>
      <dc:creator>calderg1000</dc:creator>
      <dc:date>2025-10-09T19:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845752#M167191</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3704761"&gt;@scott_bolton&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my simple version , without the need of temporary line&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(MA:ginters ....) function, accepts 5 arguments, the first 4 represent the 4 points of the selected segments and the last is the picked reference point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the geometric idea is to create a right angled (90) triangle on the first selected line (base) with one of the points on the second selected line, finding the direction of the face edge [ using (cos) function ] from the second point putting this vector on the picked reference point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the (c:xxx) command is to show how to use the function - supports lines or\and pline segment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;enjoy&lt;/P&gt;&lt;P&gt;Moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;;;;  MA:ginters
;;;  OCT 09, 2025 by Moshe-A

;;; Argumenst
;;; t0 - first  pt of first vector
;;; t1 - second pt of first vector
;;; t2 - first pt of second vector
;;; rpt  -  reference\picked point on first vector

(defun MA:ginters (t0 t1 t2 t3 rpt / right_angle 	       ; local function
		                     ang2 ang3 ax bx cx t4 t5) ; local variables

 ; triangle right angle
 (defun right_angle (/ a0 a1 a2)
  (setq a0 (angle t0 t1))
  (setq a1 (angle t0 t2))

  (if (&amp;gt; a1 a0)
   (setq a2 (- a1 a0))
   (setq a2 (- a0 a1))
  )
   
  (if (&amp;gt; a2 (* pi 1.5))
   (- (* pi 2) a2)
   a2
  ); if
 ); right_angle

  
 ; here start ginters
 (setq ang2 (right_angle))		; triangle right angle
  
 (setq cx (distance t0 t2))  		; triangle hypotenuse
 (setq bx (* cx (cos ang2)))		; near edge length

 (setq t4 (polar p0 (angle t0 t1) bx))
  
 (setq ax (distance t4 t2))		; face edge length
 (setq ang3 (angle t4 t2))		; face edge angle from t4
  
 (setq t5 (polar rpt ang3 ax))		; paralle vector from rpt

 (inters t2 t3 rpt t5 nil) 		; return intersection 
); MA:ginters


(vl-load-com) ; load avtivex support

(defun c:xxx (/ getVector ; local function
	        pick0 pick1 ename0 ename1 ptx0 ptx1) ; p0 p1 p2 p3 ptr PTM cr)

 ; ent - ename of selected object
 ; ppt - picked point
 (defun getVector (ent ppt Qt0 Qt1 / elist prm)
  (setq elist (entget ent))
    
  (cond
   ((eq (cdr (assoc '0 elist)) "LINE")
    (set Qt0 (vlax-curve-getStartPoint ent)) ; indirect set
    (set Qt1 (vlax-curve-getEndPoint ent))   ; indirect set
   ); case
   ((eq (cdr (assoc '0 elist)) "LWPOLYLINE")
    (setq prm (vlax-curve-getParamAtPoint ent ppt))
    (set Qt0 (vlax-curve-getPointAtParam ent (fix prm)))	; indirect set
    (set Qt1 (vlax-curve-getPointAtParam ent (1+ (fix prm))))	; indirect set
   ); case
   ( t
    (vlr-beep-reaction)
    (prompt "\n* Require line or pline *")
   )
  ); cond
 ); getVector


 ; here start c:xxx
  
 (if (and
       (setq pick0 (entsel "\nPick first line: "))
       (setq ename0 (car pick0))
       (setq ptx0 (vlax-curve-getClosestPointToProjection ename0 (cadr pick0) '(0.0 0.0 1.0)))
       (getVector ename0 ptx0 'p0 'p1)
	
       (setq pick1 (entsel "\nPick second line: "))
       (setq ename1 (car pick1))
       (setq ptx1 (vlax-curve-getClosestPointToProjection ename1 (cadr pick1) '(0.0 0.0 1.0)))
       (getVector ename1 ptx1 'p2 'p3)
	
       (setq ptr (getpoint "\nSpecify reference point on first line: "))
       (setq PTM (osnap ptr "_Nearest"))
     )
  (if (not (equal (+ (distance p0 PTM) (distance PTM p1)) (distance p0 p1) 1e-4))
   (progn
    (vlr-beep-reaction)
    (prompt "\n* Reference point is not found on first line *")
   ); progn
   ; else
   (if (setq cr (MA:ginters p0 p1 p2 p3 PTM))
    (command ".line" PTM cr "")
   )
  ); if
 ); if
  
 (princ)
); c:xxx&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 19:28:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845752#M167191</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2025-10-09T19:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845775#M167192</link>
      <description>&lt;P&gt;This will only get the projected point if the first line is horizontal. However - I see where you are thinking. you just have to get the normal correctly from the first line segment.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 19:42:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845775#M167192</guid>
      <dc:creator>pkenewell6347</dc:creator>
      <dc:date>2025-10-09T19:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845852#M167195</link>
      <description>&lt;P&gt;Based on&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4920461"&gt;@calderg1000&lt;/a&gt;&amp;nbsp;idea, This does not use a temporary line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: Updated to ignore if there is not an intersect at the normal.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:foo (/ _getunitvect a e1 e2 et1 ep1 g1 g2 n1 p1 p2 p3 pp o1 o2 sp1)
   
   (defun _getunitvect (p1 p2 / v)
      (setq v (mapcar '- p1 p2))
      (
        (lambda (l)(if (/= 0 l) (mapcar (function (lambda (x) (/ x l))) v)))
        (distance '(0 0 0) v)
      )
   )
   
   (vl-load-com)

   (if
     (and
        (setq g1 (entsel "\nSelect first line: "))
        (setq g2 (entsel "\nSelect second line: "))
     )
     (progn
         (setq p1  (cadr g1)
               e1  (car  g1)
               e2  (car  g2)
               et1 (cdr (assoc 0 (entget e1)))
               o1  (vlax-ename-&amp;gt;vla-object e1)
               o2  (vlax-ename-&amp;gt;vla-object e2)
               p1  (vlax-curve-getclosestpointto o1 p1)
         )
         (cond
            ((= et1 "LINE")
               (setq sp1 (vlax-curve-Getstartpoint o1)
                     ep1 (vlax-curve-Getendpoint   o1) 
               )
            )
            ((= et1 "LWPOLYLINE")
               (setq pp  (vlax-curve-getparamatpoint o1 p1)
                     sp1 (vlax-curve-getpointatparam o1 (fix pp))
                     ep1 (vlax-curve-getpointatparam o1 (1+ (fix pp)))
               )
            )
         )
         (setq a1 (angle sp1 ep1)
               n1 (_getunitvect p1 (polar p1 (- a1 (/ pi 2)) 1))
         )
         (if
            (and 
               (setq p2 (vlax-curve-getClosestPointToProjection o2 p1 n1 T))
               (equal
                  n1
                  (_getunitvect p1 p2)
                  0.0001
               )
            )
            (command "._line" "non" p1 "_non" p2 "")
         )
      )
   )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 20:52:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845852#M167195</guid>
      <dc:creator>pkenewell6347</dc:creator>
      <dc:date>2025-10-09T20:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845871#M167196</link>
      <description>&lt;P&gt;Projection...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:foo nil
  
  (setq e1 (Car (entsel "1: ")))
  (setq e2 (car (entsel "2: ")))
  (setq p (getpoint "point on 1: "))
  
  (setq d (vlax-curve-getfirstderiv e1 (vlax-curve-getparamatpoint e1 p)))
  (setq n (list (- (cadr d)) (car d) 0))
  
  (command "_point" "_non" (vlax-curve-getclosestpointtoprojection e2 p n t))
  
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 20:46:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845871#M167196</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2025-10-09T20:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: normal intersection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845920#M167197</link>
      <description>&lt;P&gt;That works, However - I've noticed that (vlax-curve-getclosestpointtoprojection) still returns a value even if the projection does not intersect (usually the start or end of the curve). Have to figure out a way to compare the normals and ignore if the the curve does not actually intersect.&lt;/P&gt;&lt;P&gt;I admit - I'm not good with how derivatives work.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 21:19:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/normal-intersection/m-p/13845920#M167197</guid>
      <dc:creator>pkenewell6347</dc:creator>
      <dc:date>2025-10-09T21:19:18Z</dc:date>
    </item>
  </channel>
</rss>

