<?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 Lisp modification in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-modification/m-p/10469372#M58090</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using lisp to inserting arrows on the end of line. I need this one to be modified (or new one with same arrows). I would like to insert arrow on 3d poly and 2d poly but on point I click on the poly. Also it would be an issue with direction of arrow, so I think it should be an option in lisp to change direction for 180 deg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:as (/ a e p0 p1 p2)
  (cond	((null (tblobjname "block" "_ar"))
	 (entmake '((0 . "BLOCK")
		    (100 . "AcDbEntity")
		    (67 . 0)
		    (8 . "0")
		    (100 . "AcDbBlockReference")
		    (2 . "_ar")
		    (10 0 0 0)
		    (70 . 0)
		   )
	 )
	 (entmake '((0 . "LWPOLYLINE")
		    (100 . "AcDbEntity")
		    (67 . 0)
		    (8 . "0")
		    (100 . "AcDbPolyline")
		    (90 . 2)
		    (70 . 128)
		    (10 0 0 0)
		    (41 . 0.347296)
		    (10 -0.984807 0.0)
		    (40 . 0.347296)
		    (41 . 0.347296)
		   )
	 )
	 (entmake '((0 . "ENDBLK") (100 . "AcDbBlockEnd") (8 . "0")))
	)
  )
  (cond	((and (setq e (entsel "\Pick a line: "))
	      (= "LINE" (cdr (assoc 0 (entget (car e)))))
	      (progn (initget 6) (or (setq sc (getdist "\nEnter scale: &amp;lt;0.2&amp;gt; ")) (setq sc 0.2)))
	 )
	 (setq
	   p0 (vlax-curve-getclosestpointtoprojection (car e) (trans (cadr e) 1 (car e)) '(0. 0. 1.))
	 )
	 (setq e (entget (car e)))
	 (setq p1 (cdr (assoc 10 e)))
	 (setq p2 (cdr (assoc 11 e)))
	 (setq a (angle p1 p2))
	 (setq p1 (cond	((&amp;lt; (distance p1 p0) (distance p2 p0)) (list p1 (+ pi a)))
			((list p2 a))
		  )
	 )
	 (entmakex (list '(0 . "insert")
			 (cons 10 (car p1))
			 '(2 . "_ar")
			 (assoc 8 e)
			 (cons 50 (cadr p1))
			 (cons 41 sc)
			 (cons 42 sc)
			 (cons 43 sc)
		   )
	 )
	)
  )
  (princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jul 2021 21:18:24 GMT</pubDate>
    <dc:creator>BB8x</dc:creator>
    <dc:date>2021-07-14T21:18:24Z</dc:date>
    <item>
      <title>Lisp modification</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-modification/m-p/10469372#M58090</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using lisp to inserting arrows on the end of line. I need this one to be modified (or new one with same arrows). I would like to insert arrow on 3d poly and 2d poly but on point I click on the poly. Also it would be an issue with direction of arrow, so I think it should be an option in lisp to change direction for 180 deg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:as (/ a e p0 p1 p2)
  (cond	((null (tblobjname "block" "_ar"))
	 (entmake '((0 . "BLOCK")
		    (100 . "AcDbEntity")
		    (67 . 0)
		    (8 . "0")
		    (100 . "AcDbBlockReference")
		    (2 . "_ar")
		    (10 0 0 0)
		    (70 . 0)
		   )
	 )
	 (entmake '((0 . "LWPOLYLINE")
		    (100 . "AcDbEntity")
		    (67 . 0)
		    (8 . "0")
		    (100 . "AcDbPolyline")
		    (90 . 2)
		    (70 . 128)
		    (10 0 0 0)
		    (41 . 0.347296)
		    (10 -0.984807 0.0)
		    (40 . 0.347296)
		    (41 . 0.347296)
		   )
	 )
	 (entmake '((0 . "ENDBLK") (100 . "AcDbBlockEnd") (8 . "0")))
	)
  )
  (cond	((and (setq e (entsel "\Pick a line: "))
	      (= "LINE" (cdr (assoc 0 (entget (car e)))))
	      (progn (initget 6) (or (setq sc (getdist "\nEnter scale: &amp;lt;0.2&amp;gt; ")) (setq sc 0.2)))
	 )
	 (setq
	   p0 (vlax-curve-getclosestpointtoprojection (car e) (trans (cadr e) 1 (car e)) '(0. 0. 1.))
	 )
	 (setq e (entget (car e)))
	 (setq p1 (cdr (assoc 10 e)))
	 (setq p2 (cdr (assoc 11 e)))
	 (setq a (angle p1 p2))
	 (setq p1 (cond	((&amp;lt; (distance p1 p0) (distance p2 p0)) (list p1 (+ pi a)))
			((list p2 a))
		  )
	 )
	 (entmakex (list '(0 . "insert")
			 (cons 10 (car p1))
			 '(2 . "_ar")
			 (assoc 8 e)
			 (cons 50 (cadr p1))
			 (cons 41 sc)
			 (cons 42 sc)
			 (cons 43 sc)
		   )
	 )
	)
  )
  (princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 21:18:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-modification/m-p/10469372#M58090</guid>
      <dc:creator>BB8x</dc:creator>
      <dc:date>2021-07-14T21:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp modification</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-modification/m-p/10469972#M58091</link>
      <description>&lt;P&gt;Maybe change some of the code, this gives a pt and an angle in radians for pick point, then yes need a flip option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun alg-ang (obj pnt)
  (angle '(0. 0. 0.)
     (vlax-curve-getfirstderiv
       obj
       (vlax-curve-getparamatpoint
         obj
         pnt
       )
     )
  )
)

(setq e (entsel "\Pick a P/line: "))
(setq pt (cadr e))
(setq lobj (vlax-ename-&amp;gt;vla-object (car e)))
(setq pt (vlax-curve-getclosestpointto lobj pt))

(setq ang (alg-ang lobj pt))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not tested on 3dpoly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 04:19:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-modification/m-p/10469972#M58091</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-07-15T04:19:23Z</dc:date>
    </item>
  </channel>
</rss>

