<?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: (LISP)How do we create points on a line? in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-how-do-we-create-points-on-a-line/m-p/11622440#M37070</link>
    <description>&lt;P&gt;Your sample drawing has one of the Points &lt;EM&gt;at the start&lt;/EM&gt; of each Line, but your description doesn't limit it to that.&amp;nbsp; Here's another way, including User specification of &lt;EM&gt;all 3&lt;/EM&gt; distances, with zero offered as default for the first one.&amp;nbsp; And it checks each Line for whether it's at least as long as the third distance before placing any Points on it, and notifies you if not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(vl-load-com); if needed
(defun c:3PL (/ d1 d2 d3 ss n lin)
  (initget 4); no negative [zero and Enter permitted for first one]
  (setq d1 (cond ((getdist "\nFirst distance &amp;lt;0&amp;gt;: ")) (0)))
  (initget 7); no Enter, no zero, no negative
  (setq d2 (getdist "\nSecond distance: "))
  (initget 7)
  (setq d3 (getdist "\nThird distance: "))
  (prompt "\nTo place 3 Points at those distances on Lines,")
  (if (setq ss (ssget '((0 . "LINE"))))
    (repeat (setq n (sslength ss))
      (setq lin (ssname ss (setq n (1- n))))
      (if (&amp;gt;= (vlax-curve-getEndParam lin) d3)
        (command
          "_.point" "_non" (vlax-curve-getPointAtDist lin d1)
          "_.point" "_non" (vlax-curve-getPointAtDist lin d2)
          "_.point" "_non" (vlax-curve-getPointAtDist lin d3)
        ); command
        (prompt "\nLine is not long enough for all 3 Points.")
      ); if
    ); repeat
  ); if
  (prin1)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It could use the usual enhancements [Layer control for the Points if desired, Undo begin/end wrapping, *error* handling if it changes anything that should be changed back, etc.], and could be adjusted easily to work with other object types [Arcs, Polylines, etc.].&amp;nbsp; And it could do other things, such as remember all 3 of your distances and offer them as defaults on subsequent use, instead of offering only zero and only for the first distance, or to consider the start of every Line to be in a particular direction regardless of its actual drawn direction, etc.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Dec 2022 17:17:53 GMT</pubDate>
    <dc:creator>Kent1Cooper</dc:creator>
    <dc:date>2022-12-15T17:17:53Z</dc:date>
    <item>
      <title>(LISP)How do we create points on a line?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-how-do-we-create-points-on-a-line/m-p/11621718#M37067</link>
      <description>&lt;P&gt;Hi. Can we select a line to create a point of length on a different line?&amp;nbsp;&amp;nbsp;Each day I have to create three points on one line, one at a time. Can I do it at once, multiple lines?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 01:40:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-how-do-we-create-points-on-a-line/m-p/11621718#M37067</guid>
      <dc:creator>mik501_</dc:creator>
      <dc:date>2023-11-03T01:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: (LISP)How do we create points on a line?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-how-do-we-create-points-on-a-line/m-p/11621840#M37068</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;For exemple this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:THREE_PT_ON_LINES ( / ss d1 d2 dxf_ent dxf_10 dxf_11 ang)
  (princ "\nSelect lines")
  (cond
    ((setq ss (ssget '((0 . "LINE"))))
      (initget 7)
      (setq d1 (getdist "\nFirst distance?: "))
      (initget 7)
      (setq d2 (getdist "\nSecond distance?: "))
      (repeat (setq n (sslength ss))
        (setq
          dxf_ent (entget (ssname ss (setq n (1- n))))
          dxf_10 (cdr (assoc 10 dxf_ent))
          dxf_11 (cdr (assoc 11 dxf_ent))
          ang (angle dxf_10 dxf_11)
        )
        (entmake
          (list
            (cons 0 "POINT")
            (cons 10 dxf_10)
          )
        )
        (entmake
          (list
            (cons 0 "POINT")
            (cons 10 (polar dxf_10 ang d1))
          )
        )
        (entmake
          (list
            (cons 0 "POINT")
            (cons 10 (polar dxf_10 ang d2))
          )
        )
      )
    )
  )
  (prin1)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 15 Dec 2022 08:29:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-how-do-we-create-points-on-a-line/m-p/11621840#M37068</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2022-12-15T08:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: (LISP)How do we create points on a line?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-how-do-we-create-points-on-a-line/m-p/11621863#M37069</link>
      <description>Hi. It works great. thank you very very much.</description>
      <pubDate>Thu, 15 Dec 2022 08:47:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-how-do-we-create-points-on-a-line/m-p/11621863#M37069</guid>
      <dc:creator>mik501_</dc:creator>
      <dc:date>2022-12-15T08:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: (LISP)How do we create points on a line?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-how-do-we-create-points-on-a-line/m-p/11622440#M37070</link>
      <description>&lt;P&gt;Your sample drawing has one of the Points &lt;EM&gt;at the start&lt;/EM&gt; of each Line, but your description doesn't limit it to that.&amp;nbsp; Here's another way, including User specification of &lt;EM&gt;all 3&lt;/EM&gt; distances, with zero offered as default for the first one.&amp;nbsp; And it checks each Line for whether it's at least as long as the third distance before placing any Points on it, and notifies you if not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(vl-load-com); if needed
(defun c:3PL (/ d1 d2 d3 ss n lin)
  (initget 4); no negative [zero and Enter permitted for first one]
  (setq d1 (cond ((getdist "\nFirst distance &amp;lt;0&amp;gt;: ")) (0)))
  (initget 7); no Enter, no zero, no negative
  (setq d2 (getdist "\nSecond distance: "))
  (initget 7)
  (setq d3 (getdist "\nThird distance: "))
  (prompt "\nTo place 3 Points at those distances on Lines,")
  (if (setq ss (ssget '((0 . "LINE"))))
    (repeat (setq n (sslength ss))
      (setq lin (ssname ss (setq n (1- n))))
      (if (&amp;gt;= (vlax-curve-getEndParam lin) d3)
        (command
          "_.point" "_non" (vlax-curve-getPointAtDist lin d1)
          "_.point" "_non" (vlax-curve-getPointAtDist lin d2)
          "_.point" "_non" (vlax-curve-getPointAtDist lin d3)
        ); command
        (prompt "\nLine is not long enough for all 3 Points.")
      ); if
    ); repeat
  ); if
  (prin1)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It could use the usual enhancements [Layer control for the Points if desired, Undo begin/end wrapping, *error* handling if it changes anything that should be changed back, etc.], and could be adjusted easily to work with other object types [Arcs, Polylines, etc.].&amp;nbsp; And it could do other things, such as remember all 3 of your distances and offer them as defaults on subsequent use, instead of offering only zero and only for the first distance, or to consider the start of every Line to be in a particular direction regardless of its actual drawn direction, etc.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 17:17:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-how-do-we-create-points-on-a-line/m-p/11622440#M37070</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-12-15T17:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: (LISP)How do we create points on a line?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-how-do-we-create-points-on-a-line/m-p/11626360#M37071</link>
      <description>&lt;P&gt;Very Thank you kentcooper .&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2022 04:50:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-how-do-we-create-points-on-a-line/m-p/11626360#M37071</guid>
      <dc:creator>mik501_</dc:creator>
      <dc:date>2022-12-17T04:50:37Z</dc:date>
    </item>
  </channel>
</rss>

