<?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 for measuring angles between xlines in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13148057#M6441</link>
    <description>&lt;P&gt;&lt;FONT color="#0000FF"&gt;Bonjour &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13296553"&gt;@Shanky1999&lt;/a&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;I would prefer option 2 if possible. &lt;/STRONG&gt;&lt;/EM&gt;I don't understand what is option 2, sorry.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;To change the angle precision, I have updated my code in message 7, and now the precision i the value of the environment variable LUPREC.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;Amicalement&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2024 13:30:01 GMT</pubDate>
    <dc:creator>-didier-</dc:creator>
    <dc:date>2024-11-13T13:30:01Z</dc:date>
    <item>
      <title>LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13140349#M6428</link>
      <description>&lt;P&gt;Hi, I wanted to know if we can create an autocad lisp which can measure angle between two xlines.&lt;/P&gt;&lt;P&gt;I know xlines and rays dont have any vertex, but can we create a lisp which can create a line from the intersection of these two xlines and measure them ?&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2024 07:17:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13140349#M6428</guid>
      <dc:creator>Shanky1999</dc:creator>
      <dc:date>2024-11-09T07:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13140462#M6429</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Here's a way which works whatever the plane the xlines lies on. It checks if the two xline intersects (i.e., they lies on the same plane and aren't parallel).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;;; angleXline
;; Returns the angle in radians between two Xlines
;; or nil if Xlines are parallel or not coplanar.
;;
;; Arguments
;; xline1: first xline (ENAME)
;; xline2: second xline (ENAME)
(defun angleXlines (xline1 xline2 / v1 v2 norm)
  (if
    (inters
	(getpropertyvalue xline1 "BasePoint")
	(getpropertyvalue xline1 "SecondPoint")
	(getpropertyvalue xline2 "BasePoint")
	(getpropertyvalue xline2 "SecondPoint")
	nil
      )
     (progn
       (setq v1	  (getpropertyvalue xline1 "UnitDir")
	     v2	  (getpropertyvalue xline2 "UnitDir")
	     norm (list
		    (- (* (cadr v1) (caddr v2)) (* (caddr v1) (cadr v2)))
		    (- (* (caddr v1) (car v2)) (* (car v1) (caddr v2)))
		    (- (* (car v1) (cadr v2)) (* (cadr v1) (car v2)))
		  )
       )
       (- (angle '(0. 0. 0.) (trans v2 0 norm))
	  (angle '(0. 0. 0.) (trans v1 0 norm))
       )
     )
  )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2024 13:18:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13140462#M6429</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2024-11-09T13:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13140481#M6430</link>
      <description>&lt;P&gt;&lt;FONT color="#0000FF"&gt;Bonjour &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13296553"&gt;@Shanky1999&lt;/a&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;What do you need ?&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;FONT color="#0000FF"&gt;The value of the angle on the command line as an information ?&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT color="#0000FF"&gt;The value of the angle on the drawing as an entity "angular dimension”?&lt;/FONT&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;Amicalement&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2024 09:31:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13140481#M6430</guid>
      <dc:creator>-didier-</dc:creator>
      <dc:date>2024-11-09T09:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13140627#M6431</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13296553"&gt;@Shanky1999&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;I know xlines and rays dont have any vertex, but can we create a lisp which can create a line from the intersection of these two xlines and measure them ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;They do have defined points, like Lines (DXF codes 10 &amp;amp; 11).&amp;nbsp; The 11 value is a unit vector relative to the origin 10 value [Osnappable as the ENDpoint of a Ray, or the MIDpoint of an Xline].&lt;/P&gt;
&lt;P&gt;There's no need to create a Line.&amp;nbsp; This will report, in your current settings for angular mode and precision, the &lt;EM&gt;two&lt;/EM&gt; angles [projected onto the current drawing plane if they are in different Coordinate Systems] between two selected objects of either or both kinds:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun C:XLRA ; = XLine/Ray Angle
  (/ e1 e2 e1data e2data e1ang e2ang)
  (setq
    e1 (car (entsel "\nOne XLINE or RAY: "))
    e2 (car (entsel "\nOther XLINE or RAY: "))
    e1data (entget e1)
    e2data (entget e2)
    e1ang (rem (angle '(0 0 0) (cdr (assoc 11 e1data))) pi)
    e2ang (rem (angle '(0 0 0) (cdr (assoc 11 e2data))) pi)
    angbetween (abs (- e1ang e2ang))
  ); setq
  (prompt
    (strcat
      "\nAngles between those two XLINES/RAYS are "
      (angtos angbetween) " and " (angtos (- pi angbetween)) "."
    ); strcat
  ); alert
  (prin1)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It will say the angles are 0° and 180° if they're parallel.&lt;/P&gt;
&lt;P&gt;It leaves the 'angbetween' variable [in radians] available for you to use in any way you need.&lt;/P&gt;
&lt;P&gt;It could be made to do things like verify you selected the right kind(s) of thing(s), that you didn't select the same thing twice, etc.....&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2024 13:06:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13140627#M6431</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-11-09T13:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13140634#M6432</link>
      <description>&lt;P&gt;The dot product of the Xlines' directions gives you the cosine of the angle, assuming that the directions are always unit vectors.&lt;/P&gt;&lt;P&gt;Then you can&amp;nbsp; extract the angle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun Xangle (e1 e2 / v1 v2 v)
  (setq v1 (cdr (assoc 11 (entget e1)))
        v2 (cdr (assoc 11 (entget e2)))
        v  (apply '+ (mapcar '* v1 v2))
  )
  (if
    (equal v 0.0 1e-8)
    (/ pi 2.0)
    (atan (/ (sqrt (- 1 (* v v))) v))
  )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: alternative, to return the acute angle.&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun Xangle (e1 e2 / v1 v2 v a)
  (setq v1 (cdr (assoc 11 (entget e1)))
        v2 (cdr (assoc 11 (entget e2)))
        v  (apply '+ (mapcar '* v1 v2))
        a  (atan (sqrt (- 1 (* v v))) v)
  )
  (if (&amp;gt; a (/ pi 2)) (- pi a) a)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 09 Nov 2024 22:29:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13140634#M6432</guid>
      <dc:creator>MunteanStefan</dc:creator>
      <dc:date>2024-11-09T22:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13140950#M6433</link>
      <description>&lt;P&gt;hey,&lt;/P&gt;&lt;P&gt;yet another one&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:x_ray_angle (/ dir_1 dir_2 xy_diff)
  (setq dir_1 (vlax-get (vlax-ename-&amp;gt;vla-object (car (entsel "\nPick 1st ray or xline: "))) 'directionvector)
	dir_2 (vlax-get (vlax-ename-&amp;gt;vla-object (car (entsel "\nPick 2nd ray or xline: "))) 'directionvector)
	xy_diff (mapcar '- dir_1 dir_2)
  )
  (princ "\nBetween angle: ")
  (cond
    ((or (&amp;lt; (abs (car xy_diff)) 1e-12) (&amp;lt; (abs (cadr xy_diff)) 1e-12)) pi)
    (t (* 2 (atan (/ (setq a (sqrt (apply '+ (mapcar '* xy_diff xy_diff)))) (sqrt (- 4 (* a a)))))))
  )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 09 Nov 2024 19:12:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13140950#M6433</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2024-11-09T19:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13141777#M6434</link>
      <description>&lt;P&gt;&lt;FONT color="#0000FF"&gt;Bonjour&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;All these programs are fine, but I would like to present my version because they do not return the angles of the selected entities. I wanted to do a different treatment.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;I explain, whatever the entities selected, the programs return a single angle value, and it is not always the one that corresponds to the selection.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;Mine is more "simple", I do not use the vectors, but the selection points to calculate the angle that really corresponds to the selection.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;I have somewhat arranged the presentation by testing the angular units of the system as well as the local language.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;Here is my code :&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun language ()
    (vl-registry-read
        (strcat "HKEY_LOCAL_MACHINE\\" (vlax-product-key))
        "Language")
    )
(defun rad2dms (a)
    (setq deg (/ (* a 180) pi))
    (setq minu (* (- deg (fix deg))60))
    (setq sec ( * (- minu (fix minu)) 60))
    (strcat (itoa (fix deg)) "° , " (itoa (fix minu)) "' , " (rtos sec 2 2) "''")    
    )

(defun c:da:anglexlines ( / ang int p1 p2 xl1 xl2)
    (setq lang (language))
    (if ( = lang "Français")
        (progn
            (setq xl1 (entsel "\nChoix de la première XLINE...\n"))
            (setq xl2 (entsel "\nChoix de la deuxième XLINE...\n"))
            )
        (progn
            (setq xl1 (entsel "\nPick 1st ray or xline: "))
            (setq xl2 (entsel "\nPick 2nd ray or xline: "))
            )
        )
    (if (and (or (= "RAY" (cdr (assoc 0 (entget (car xl1)))))
                 (= "XLINE" (cdr (assoc 0 (entget (car xl1))))))
             (or (= "RAY" (cdr (assoc 0 (entget (car xl2)))))
                 (= "XLINE" (cdr (assoc 0 (entget (car xl2))))))
             )
        (progn
            (setq p1 (osnap (cadr xl1)"_nea"))
            (setq xl1 (vlax-ename-&amp;gt;vla-object (car xl1)))
            (setq p2 (osnap (cadr xl2)"_nea"))
            (setq xl2 (vlax-ename-&amp;gt;vla-object (car xl2)))
            (setq int (vla-intersectwith xl1 xl2 0))
            (setq int (vlax-safearray-&amp;gt;list (vlax-variant-value int)))
            (setq ang (abs (- (angle int p1) (angle int p2))))
            (if (&amp;gt; ang pi)
                (setq ang (abs (- (* pi 2) ang)))
                )
            (cond
                ((= 0 (getvar "aunits")) (setq ang (rtos (* (/ ang pi) 180)2 )))
                ((= 1 (getvar "aunits")) (setq ang (rad2dms ang)))
                ((= 2 (getvar "aunits")) (setq ang (rtos (* (/ ang pi) 200)2 )))
                ((= 3 (getvar "aunits")) (setq ang (rtos ang 2 )))
                ((= 4 (getvar "aunits"))
                 (if ( = lang "Français")
                     (setq ang "ce système d'unités n'est pas prévu")
                     (setq ang "this unit system is not intended")
                     ))
                )
            
            (if ( = lang "Français")
                (alert (strcat "L'angle en unités utilisateur est de  : " ang))
                (alert (strcat "The angle in user units is  : " ang))
                )
            )
        (if ( = lang "Français")
            (alert "les entités sélectionnées ne sont pas xline ou ray.")
            (alert "the selected entities are not xline or ray.")
            )
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;Amicalement&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 13:25:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13141777#M6434</guid>
      <dc:creator>-didier-</dc:creator>
      <dc:date>2024-11-13T13:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13141828#M6435</link>
      <description>&lt;P&gt;An another method&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:xline2alpha ( / x ss1 obj_straight dir_vec deriv alpha)
  (repeat 2
    (princ (strcat "\nSelect " (if x "Second " (setq x "First ")) "ray or xline: "))
    (while (not (setq ss1 (ssget "_+.:E:S" '((0 . "XLINE,RAY"))))))
    (setq
      obj_straight (vlax-ename-&amp;gt;vla-object (ssname ss1 0))
      dir_vec (vlax-get-property obj_straight 'DirectionVector)
      deriv (vlax-safearray-&amp;gt;list (vlax-variant-value dir_vec))
      alpha (if alpha (- alpha (atan (cadr deriv) (car deriv))) (atan (cadr deriv) (car deriv)))
    )
  )
  (print alpha)
  (angtos alpha (getvar "AUNITS") 4)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 10 Nov 2024 14:44:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13141828#M6435</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2024-11-10T14:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13141879#M6436</link>
      <description>&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;Bonjour &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/524107"&gt;@CADaSchtroumpf&lt;/a&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;I’m sorry to insist but, your program is concerned, as others are.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&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="Snag_2ac68291.png" style="width: 300px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1432082i297E9B24205CC8B2/image-size/small?v=v2&amp;amp;px=200" role="button" title="Snag_2ac68291.png" alt="Snag_2ac68291.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;That is why I have proposed a different approach.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;Amicalement&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2024 15:41:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13141879#M6436</guid>
      <dc:creator>-didier-</dc:creator>
      <dc:date>2024-11-10T15:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13142253#M6437</link>
      <description>&lt;P&gt;Regards&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13296553"&gt;@Shanky1999&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Previously configure "DIMSTYLE" according to the characteristics of your work and the reference to objects, then apply the routine,&amp;nbsp;It also allows you to obtain the external angle...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;;;;___
(defun c:angXl (/ sn i j p lp ps)
 (princ "\nSelect Two Xline")
  (setq
    sn (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget '((0 . "*line"))))))
  )
  (foreach i sn
    (setq
      p (list (cdr (assoc 10 (entget i))) (cdr (assoc 11 (entget i))))
    )
    (setq lp (cons p lp))
  )
  (setq ps (inters (caar lp)(mapcar '+ (caar lp) (cadar lp))(caadr lp)(mapcar '+ (caadr lp) (cadadr lp))nil)
  )
  (command "_dimangular" "" "_non" ps "pause" "pause" "pause")
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2024 23:17:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13142253#M6437</guid>
      <dc:creator>calderg1000</dc:creator>
      <dc:date>2024-11-10T23:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13142479#M6438</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/691430"&gt;@-didier-&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's say that my return (in radians) is good; for calculation, for example for a submission to (entmake)&lt;BR /&gt;Afterwards, for a correct display in the angular unit used, it is enough to take into account the variables and the management of negative angles.&lt;BR /&gt;This version displays the two angles (because there are two after all; the complementary...)&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:xline2alpha ( / x ss1 obj_straight dir_vec deriv alpha)
  (repeat 2
    (princ (strcat "\nSelect " (if x "Second " (setq x "First ")) "ray or xline: "))
    (while (not (setq ss1 (ssget "_+.:E:S" '((0 . "XLINE,RAY"))))))
    (setq
      obj_straight (vlax-ename-&amp;gt;vla-object (ssname ss1 0))
      dir_vec (vlax-get-property obj_straight 'DirectionVector)
      deriv (vlax-safearray-&amp;gt;list (vlax-variant-value dir_vec))
      alpha (if alpha (- alpha (atan (cadr deriv) (car deriv))) (atan (cadr deriv) (car deriv)))
      alpha (if (&amp;lt; alpha 0) (rem (- (* 2 pi) alpha) pi) (rem alpha pi))
    )
  )
  (alert
    (strcat
      (rtos alpha 2 4)
      "\n"
      (angtos (- pi alpha (getvar "ANGBASE")) (getvar "AUNITS") 4)
      "\n"
      (angtos (- alpha (getvar "ANGBASE")) (getvar "AUNITS") 4)
    )
  )
  (prin1)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 Nov 2024 02:56:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13142479#M6438</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2024-11-11T02:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13147935#M6439</link>
      <description>&lt;P&gt;I would prefer option 2 if possible.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 12:19:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13147935#M6439</guid>
      <dc:creator>Shanky1999</dc:creator>
      <dc:date>2024-11-13T12:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13147959#M6440</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I would have to increase the angle precision, I would have to do it in dimstyle right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 12:29:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13147959#M6440</guid>
      <dc:creator>Shanky1999</dc:creator>
      <dc:date>2024-11-13T12:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13148057#M6441</link>
      <description>&lt;P&gt;&lt;FONT color="#0000FF"&gt;Bonjour &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13296553"&gt;@Shanky1999&lt;/a&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;I would prefer option 2 if possible. &lt;/STRONG&gt;&lt;/EM&gt;I don't understand what is option 2, sorry.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;To change the angle precision, I have updated my code in message 7, and now the precision i the value of the environment variable LUPREC.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;Amicalement&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 13:30:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13148057#M6441</guid>
      <dc:creator>-didier-</dc:creator>
      <dc:date>2024-11-13T13:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13148213#M6442</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/691430"&gt;@-didier-&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;... the precision i the value of the environment variable LUPREC.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;[Do you perhaps mean the &lt;FONT color="#0000FF"&gt;System&lt;/FONT&gt; Variable &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;A&lt;/FONT&gt;&lt;/STRONG&gt;UPREC?&amp;nbsp; &amp;nbsp;And I suggest the use of&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; (angtos)&lt;/STRONG&gt; &lt;/FONT&gt;rather than&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; (rtos)&lt;/STRONG&gt; &lt;/FONT&gt;functions in relation to the string conversion of the 'ang' variable.&amp;nbsp; That will go to text directly in the current angular units, so some of your calculations should not be needed, nor probably the&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; (cond)&lt;/STRONG&gt; &lt;/FONT&gt;function that considers the AUNITS System Variable setting.]&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 14:53:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13148213#M6442</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-11-13T14:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13148313#M6443</link>
      <description>&lt;P&gt;Regards&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13296553"&gt;@Shanky1999&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, by editing the dimensioning style, you can configure the output, both the format of the units and the precision.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="calderg1000_0-1731512493496.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1433417i1D5DD1E10BBE689D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="calderg1000_0-1731512493496.png" alt="calderg1000_0-1731512493496.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 15:44:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13148313#M6443</guid>
      <dc:creator>calderg1000</dc:creator>
      <dc:date>2024-11-13T15:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13148608#M6444</link>
      <description>&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;Bonjour &lt;/STRONG&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT color="#0000FF"&gt;OK for the variable Sytem is better than environment.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT color="#0000FF"&gt;I hesitated for angtos, but this function taking into account the settings of the direction of the angles poses problems because I do not know how the machine is set by the person who asks the question.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT color="#0000FF"&gt;And finally rtos takes LUPREC but ignores AUPREC, the help says this :&lt;BR /&gt;&lt;/FONT&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;The&amp;nbsp;&lt;SAMP id="GUID-D03ABBC2-939A-44DB-8C93-FC63B64DE4A2__GUID-B0C4D062-84E8-47EF-85D0-712BB4F19254" class="ph codeph" style="color: #333333; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 500; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;"&gt;rtos&lt;/SAMP&gt;&amp;nbsp;function returns a string that is the representation of&amp;nbsp;number&amp;nbsp;according to the settings &lt;BR /&gt;of&amp;nbsp;mode,&amp;nbsp;precision, and the AutoCAD UNITMODE, DIMZIN, LUNITS, and LUPREC system variables.&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;&lt;BR /&gt;&lt;BR /&gt;Amicalement&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 18:11:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13148608#M6444</guid>
      <dc:creator>-didier-</dc:creator>
      <dc:date>2024-11-13T18:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13152424#M6445</link>
      <description>&lt;P&gt;ok thanks,&lt;/P&gt;&lt;P&gt;I just needed the measurement to be shown in the dwg&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 11:18:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13152424#M6445</guid>
      <dc:creator>Shanky1999</dc:creator>
      <dc:date>2024-11-15T11:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13152431#M6446</link>
      <description>&lt;P&gt;i wanted option 2 in this case, but thanks I got what I needed&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 11:20:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13152431#M6446</guid>
      <dc:creator>Shanky1999</dc:creator>
      <dc:date>2024-11-15T11:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: LISP for measuring angles between xlines</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13152436#M6447</link>
      <description>&lt;P&gt;this lisp worked as I intended, although all of your code worked, it would display the angle as an alert, I wanted it to be shown as a dimension on drawing.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 11:22:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-measuring-angles-between-xlines/m-p/13152436#M6447</guid>
      <dc:creator>Shanky1999</dc:creator>
      <dc:date>2024-11-15T11:22:56Z</dc:date>
    </item>
  </channel>
</rss>

