<?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: Help with little lisp in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13042569#M8778</link>
    <description>&lt;P&gt;I can propose this?&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:dvent ( / ogplwidth firstpt obj dxf_obj obj pt1_start pt1_end par pt2_start pt2_end name_blk dxf_210)
  (defun z_dir (p1 p2 / )
    (trans
      '(0.0 1.0 0.0)
      (mapcar
        '(lambda (k)
          (/ k
            (sqrt
              (apply '+
                (mapcar
                  '(lambda (x) (* x x))
                  (mapcar '- p2 p1)
                )
              )
            )
          )
        )
        (mapcar '- p2 p1)
      )
      0
    )
  )
  (setq ogplwidth (getvar "plinewid"))
  (setvar "plinewid" 1.5)
  (setq firstpt (getpoint "\nSelect point at dryer start point"))
  (command "_.pline" firstpt)
  (while (= 1 (logand 1 (getvar 'cmdactive)))
    (command pause)
    (prompt "\nPick next point along path &amp;lt;Enter&amp;gt; to finish:")
  )
  (setvar "plinewid" ogplwidth)
  (setq obj (entlast))
  (if (not (tblsearch "BLOCK" "dvent"))
    (progn
      (entmake
        '(
          (0 . "BLOCK")
          (100 . "AcDbEntity")
          (67 . 0)
          (8 . "0")
          (100 . "AcDbBlockBegin")
          (70 . 0)
          (10 0.0 0.0 0.0)
          (2 . "dvent")
          (1 . "")
        )
      )
      (entmake
        '(
          (0 . "LWPOLYLINE")
          (100 . "AcDbEntity")
          (67 . 0)
          (410 . "Model")
          (8 . "0")
          (100 . "AcDbPolyline")
          (90 . 4)
          (70 . 0)
          (43 . 0.0)
          (38 . 0.0)
          (39 . 0.0)
          (10 -1.5 -2.0)
          (40 . 0.0)
          (41 . 0.0)
          (42 . 0.0)
          (91 . 0)
          (10 1.5 -2.0)
          (40 . 0.0)
          (41 . 0.0)
          (42 . 0.0)
          (91 . 0)
          (10 1.5 2.0)
          (40 . 0.0)
          (41 . 0.0)
          (42 . 0.0)
          (91 . 0)
          (10 -1.5 2.0)
          (40 . 0.0)
          (41 . 0.0)
          (42 . 0.0)
          (91 . 0)
          (210 0.0 0.0 1.0)
        )
      )
      (entmake '((0 . "ENDBLK") (8 . "0") (62 . 0) (6 . "ByBlock") (370 . -2)))
    )
  )
  (cond
    ((and
      (eq (cdr (assoc 0 (setq dxf_obj (entget obj)))) "LWPOLYLINE")
      (zerop (boole 1 128 (cdr (assoc 70 dxf_obj))))
    )
      (vl-load-com)
      (setq
        pt1_start (vlax-curve-getStartPoint obj)
        pt1_end (vlax-curve-getEndPoint obj)
        par (vlax-curve-getParamAtPoint obj pt1_end)
      )
      (cond
        ((not (zerop par))
          (setq
            pt2_start (vlax-curve-getPointAtParam obj 1)
            pt2_end (vlax-curve-getPointAtParam obj (1- par))
          )
          (foreach n (list (list pt1_start pt2_start) (list pt1_end pt2_end))
            (setq dxf_210 (z_dir (car n) (cadr n)))
            (entmake
              (list
                (cons 0 "INSERT")
                (cons 100 "AcDbEntity")
                (assoc 67 dxf_obj)
                (assoc 410 dxf_obj)
                (cons 8 (getvar "CLAYER"))
                (cons 100 "AcDbBlockReference")
                (cons 2 "dvent")
                (cons 10 (trans (car n) 0 dxf_210))
                (cons 50 (+ pi (angle (trans (car n) 0 dxf_210) (trans (cadr n) 0 dxf_210))))
                (cons 210 dxf_210)
              )
            )
          )
        )
      )
    )
    (T
      (princ "\nIsn't 2Dpolyline avalaible for this function!")
    )
  )
  (prin1)
)&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 24 Sep 2024 21:35:36 GMT</pubDate>
    <dc:creator>CADaSchtroumpf</dc:creator>
    <dc:date>2024-09-24T21:35:36Z</dc:date>
    <item>
      <title>Help with little lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13042382#M8777</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm need of assistance on this little lisp. It uses a block called dvent.dwg. I'm hoping to have the program draw the end cap rather than insert the block and wait for the rotation angle. I'm hoping there is a way to get the angle of the last segment of polyline and draw the end cap based on that angle.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DCMWA_0-1727209336444.png" style="width: 258px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1413450i2353BD0D95B8A817/image-dimensions/258x100?v=v2" width="258" height="100" role="button" title="DCMWA_0-1727209336444.png" alt="DCMWA_0-1727209336444.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for any assistance.&lt;/P&gt;&lt;P&gt;-dc&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 20:20:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13042382#M8777</guid>
      <dc:creator>DC-MWA</dc:creator>
      <dc:date>2024-09-24T20:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help with little lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13042569#M8778</link>
      <description>&lt;P&gt;I can propose this?&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:dvent ( / ogplwidth firstpt obj dxf_obj obj pt1_start pt1_end par pt2_start pt2_end name_blk dxf_210)
  (defun z_dir (p1 p2 / )
    (trans
      '(0.0 1.0 0.0)
      (mapcar
        '(lambda (k)
          (/ k
            (sqrt
              (apply '+
                (mapcar
                  '(lambda (x) (* x x))
                  (mapcar '- p2 p1)
                )
              )
            )
          )
        )
        (mapcar '- p2 p1)
      )
      0
    )
  )
  (setq ogplwidth (getvar "plinewid"))
  (setvar "plinewid" 1.5)
  (setq firstpt (getpoint "\nSelect point at dryer start point"))
  (command "_.pline" firstpt)
  (while (= 1 (logand 1 (getvar 'cmdactive)))
    (command pause)
    (prompt "\nPick next point along path &amp;lt;Enter&amp;gt; to finish:")
  )
  (setvar "plinewid" ogplwidth)
  (setq obj (entlast))
  (if (not (tblsearch "BLOCK" "dvent"))
    (progn
      (entmake
        '(
          (0 . "BLOCK")
          (100 . "AcDbEntity")
          (67 . 0)
          (8 . "0")
          (100 . "AcDbBlockBegin")
          (70 . 0)
          (10 0.0 0.0 0.0)
          (2 . "dvent")
          (1 . "")
        )
      )
      (entmake
        '(
          (0 . "LWPOLYLINE")
          (100 . "AcDbEntity")
          (67 . 0)
          (410 . "Model")
          (8 . "0")
          (100 . "AcDbPolyline")
          (90 . 4)
          (70 . 0)
          (43 . 0.0)
          (38 . 0.0)
          (39 . 0.0)
          (10 -1.5 -2.0)
          (40 . 0.0)
          (41 . 0.0)
          (42 . 0.0)
          (91 . 0)
          (10 1.5 -2.0)
          (40 . 0.0)
          (41 . 0.0)
          (42 . 0.0)
          (91 . 0)
          (10 1.5 2.0)
          (40 . 0.0)
          (41 . 0.0)
          (42 . 0.0)
          (91 . 0)
          (10 -1.5 2.0)
          (40 . 0.0)
          (41 . 0.0)
          (42 . 0.0)
          (91 . 0)
          (210 0.0 0.0 1.0)
        )
      )
      (entmake '((0 . "ENDBLK") (8 . "0") (62 . 0) (6 . "ByBlock") (370 . -2)))
    )
  )
  (cond
    ((and
      (eq (cdr (assoc 0 (setq dxf_obj (entget obj)))) "LWPOLYLINE")
      (zerop (boole 1 128 (cdr (assoc 70 dxf_obj))))
    )
      (vl-load-com)
      (setq
        pt1_start (vlax-curve-getStartPoint obj)
        pt1_end (vlax-curve-getEndPoint obj)
        par (vlax-curve-getParamAtPoint obj pt1_end)
      )
      (cond
        ((not (zerop par))
          (setq
            pt2_start (vlax-curve-getPointAtParam obj 1)
            pt2_end (vlax-curve-getPointAtParam obj (1- par))
          )
          (foreach n (list (list pt1_start pt2_start) (list pt1_end pt2_end))
            (setq dxf_210 (z_dir (car n) (cadr n)))
            (entmake
              (list
                (cons 0 "INSERT")
                (cons 100 "AcDbEntity")
                (assoc 67 dxf_obj)
                (assoc 410 dxf_obj)
                (cons 8 (getvar "CLAYER"))
                (cons 100 "AcDbBlockReference")
                (cons 2 "dvent")
                (cons 10 (trans (car n) 0 dxf_210))
                (cons 50 (+ pi (angle (trans (car n) 0 dxf_210) (trans (cadr n) 0 dxf_210))))
                (cons 210 dxf_210)
              )
            )
          )
        )
      )
    )
    (T
      (princ "\nIsn't 2Dpolyline avalaible for this function!")
    )
  )
  (prin1)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 24 Sep 2024 21:35:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13042569#M8778</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2024-09-24T21:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with little lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13042577#M8779</link>
      <description>&lt;P&gt;This is awesome. I only need the cap on the end of the final pickpoint.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 21:41:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13042577#M8779</guid>
      <dc:creator>DC-MWA</dc:creator>
      <dc:date>2024-09-24T21:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with little lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13042585#M8780</link>
      <description>&lt;P&gt;For this change at line 104&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(foreach n (list (list pt1_start pt2_start) (list pt1_end pt2_end))&lt;/LI-CODE&gt;&lt;P&gt;to&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(foreach n (list (list pt1_end pt2_end))&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 24 Sep 2024 21:45:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13042585#M8780</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2024-09-24T21:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with little lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13042638#M8781</link>
      <description>Thank you very much!!!!</description>
      <pubDate>Tue, 24 Sep 2024 21:57:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13042638#M8781</guid>
      <dc:creator>DC-MWA</dc:creator>
      <dc:date>2024-09-24T21:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help with little lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13046190#M8782</link>
      <description>&lt;P&gt;hey there,&lt;/P&gt;&lt;P&gt;how is the cap geometry related to the pline width? i mean, if a pline has a width other than 1.5? does the pline drawn always straight-segmented?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 06:50:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13046190#M8782</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2024-09-26T06:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help with little lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13047996#M8783</link>
      <description>For the use I intended for this little program, it defaults to 1.5 inches always.</description>
      <pubDate>Thu, 26 Sep 2024 18:31:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-little-lisp/m-p/13047996#M8783</guid>
      <dc:creator>DC-MWA</dc:creator>
      <dc:date>2024-09-26T18:31:37Z</dc:date>
    </item>
  </channel>
</rss>

