<?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: Bend Angles in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10661389#M54565</link>
    <description>&lt;P&gt;Here is your code. Drawing repaired because of some&amp;nbsp; error in polylines. Attached corrected one with bend angles.&lt;/P&gt;&lt;P&gt;Previous code was OK.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:count-bends ( / 
	take pointlist2d deg_to_rad rad_to_deg vect unique asin acos angles_two_vect to_counter_clockwise
	bends bends_count ss i j eo pts p1 p2 p3 v1 v2 ang cnt
	)
	(defun *error* ()
		(setvar 'cmdecho 1)
		(princ)
	)
	(defun take (amount lst / ret)(repeat amount (setq ret (cons (car lst) (take (1- amount) (cdr lst))))))
	(defun pointlist2d (lst / ret) (while lst (setq	ret (cons (take 2 lst) ret) lst (cddr lst))) (reverse ret))
	(defun deg_to_rad (deg)(* PI (/ deg 180.0)))
	(defun rad_to_deg (rad)(* 180.0 (/ rad PI)))
	(defun vect (p1 p2)(mapcar '- p2 p1))
	(defun unique(lst)(if lst (cons (car lst) (Unique (vl-remove (car lst) (cdr lst))))))
	(defun asin (x)
	  (cond 
		((and(&amp;gt; x -1.0)(&amp;lt; x 1.0)) (atan (/ x (sqrt (- 1.0 (* x x))))))
		((= x -1.0) (* -1.0 (/ PI 2)))
		((= x  1) (/ PI 2))
	  )
	)
	(defun acos (x)
	  (cond 
		((and(&amp;gt;= x -1.0)(&amp;lt;= x 1.0)) (-(* PI 0.5) (asin x)))
	  )
	) 
	(defun angles_two_vect (v1 v2 / ang xa ya za xb yb zb) 
		(if (= (length v1) 2) (setq v1 (append v1 (list 0.0))))
		(if (= (length v2) 2) (setq v2 (append v2 (list 0.0))))
		(mapcar 'set '(xa ya za xb yb zb) (append v1 v2))
		(setq ang 
			(acos 
				(/
					(+ (* xa xb)(* ya yb)(* za zb)) 
					(* (sqrt (+(* xa xa)(* ya ya)(* za za)))(sqrt (+(* xb xb)(* yb yb)(* zb zb))))
				)
			)
		)
		(if (&amp;lt; zb za) (setq ang (- (* PI 2.0) ang)))
		ang
	)
	(setvar 'cmdecho 0)
	(setq bends '(0.0 11.25 22.5 45.0 60.0 90.0))
	(setq bends_count '((0 . 0) (11.25 . 0) (22.5 . 0) (45.0 . 0) (60.0 . 0) (90.0 . 0)))
	(setq ss (ssget '((0 . "LWPOLYLINE")(-4 . "&amp;gt;=")(90 . 3))) j -1)
	(cond 
		((and ss)
			(while (&amp;lt; (setq j (1+ j)) (sslength ss))
				(setq eo (vlax-ename-&amp;gt;vla-object (ssname ss j)))
				(cond 
					((= (vlax-get eo 'ObjectName) "AcDbPolyline") 
						(setq pts (pointlist2d(vlax-get eo 'Coordinates)))
						(cond
							((= (vlax-get eo 'Closed) -1)(setq pts (append (unique pts) (take 2 pts))))
							((&amp;lt;= (distance (vlax-curve-getStartPoint eo)(vlax-curve-getEndPoint eo)) 1e-8)(setq pts (append (unique pts) (last(take 2 pts)))))
						)
						(setq i 0)
						(while (&amp;lt; (setq i (1+ i)) (1- (length pts)))
							(setq p1 (nth (1- i) pts) p2 (nth i pts) p3 (nth (1+ i) pts) v1 (vect p1 p2) v2 (vect p2 p3) ang (rad_to_deg (-  PI (angles_two_vect v1 v2))))
							(if (&amp;gt; ang 90.0) (setq ang (- 180.0 ang)))
							(setq ang (car (vl-sort bends '(lambda (x y)(&amp;lt; (abs(- x ang))(abs(- y ang)))))))
							(if (&amp;gt; ang 0.0)
								(entmake
									(list
										(cons 0 "TEXT")
										(cons 100 "AcDbText")
										(cons 10 p2)
										(cons 40 4)
										(cons 1 (rtos ang 2 2))
										(cons 50 0)
										(cons 100 "AcDbText")
									)
								)								
							)
							(setq cnt (1+(cdr (assoc ang bends_count))))
							(setq bends_count (subst (cons ang cnt) (assoc ang bends_count) bends_count))
						)	
					)
				)
			)
			(setq bends_count (cdr bends_count))
			(foreach ent bends_count
				(princ (strcat "\n" (rtos (car ent) 2 2) " --&amp;gt; " (itoa (cdr ent))))
			)
		)
	)
	(setvar 'cmdecho 1)
	(princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Oct 2021 19:47:35 GMT</pubDate>
    <dc:creator>hak_vz</dc:creator>
    <dc:date>2021-10-01T19:47:35Z</dc:date>
    <item>
      <title>Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10655098#M54553</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello All,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm looking to see if anyone has a lisp routine that will automatically Calculated the quantity of bends. In my project I have a lot of unclosed polylines, and my target is to check the quantity of different&amp;nbsp;angles means 11.25,22.5,45,&amp;amp;90 along with tee connections. for more clarification please check my attached drawing.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 13:28:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10655098#M54553</guid>
      <dc:creator>ishaq03</dc:creator>
      <dc:date>2021-09-29T13:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10655453#M54554</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3775760"&gt;@ishaq03&lt;/a&gt;&amp;nbsp; I've checked your sample. You polylines&amp;nbsp; are really have different bend angles, so&amp;nbsp; 90° is either 89.55 or 90.22&amp;nbsp;&amp;nbsp; and so on. Angles are not created with precision.&lt;/P&gt;&lt;P&gt;Also, you didn't responded to &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-the-center-line-horizontally-on-close-polyline-and-extend/m-p/10647968#M421072" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-the-center-line-horizontally-on-close-polyline-and-extend/m-p/10647968#M421072&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 15:21:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10655453#M54554</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-29T15:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10656203#M54555</link>
      <description>&lt;P&gt;Work in segments. Hide all unnecessary objects. This will count all bends except T joints. Since angles are inconsistent they are all treated as nearest value to 0 11.25 22.5 45 60 90 Small bends are added to value 0 and can be ignored. You can mark t joints with some symbol in separate layer and can count them later with simple selection.&lt;/P&gt;&lt;P&gt;This is code to start with since your information provided is really &lt;SPAN&gt;insufficient.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Its not tested and result may be wrong&lt;/SPAN&gt;&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 c:count-bends ( / 
	take pointlist2d deg_to_rad rad_to_deg vect unique asin acos angles_two_vect to_counter_clockwise
	bends bends_count ss i j eo pts p1 p2 p3 v1 v2 ang cnt
	)
	(defun *error* ()
		(setvar 'cmdecho 1)
		(princ)
	)
	(defun take (amount lst / ret)(repeat amount (setq ret (cons (car lst) (take (1- amount) (cdr lst))))))
	(defun pointlist2d (lst / ret) (while lst (setq	ret (cons (take 2 lst) ret) lst (cddr lst))) (reverse ret))
	(defun deg_to_rad (deg)(* PI (/ deg 180.0)))
	(defun rad_to_deg (rad)(* 180.0 (/ rad PI)))
	(defun vect (p1 p2)(mapcar '- p2 p1))
	(defun unique(lst)(if lst (cons (car lst) (Unique (vl-remove (car lst) (cdr lst))))))
	(defun asin (x)
	  (cond 
		((and(&amp;gt; x -1.0)(&amp;lt; x 1.0)) (atan (/ x (sqrt (- 1.0 (* x x))))))
		((= x -1.0) (* -1.0 (/ PI 2)))
		((= x  1) (/ PI 2))
	  )
	)
	(defun acos (x)
	  (cond 
		((and(&amp;gt;= x -1.0)(&amp;lt;= x 1.0)) (-(* PI 0.5) (asin x)))
	  )
	) 
	(defun angles_two_vect (v1 v2 / ang xa ya za xb yb zb) 
		(if (= (length v1) 2) (setq v1 (append v1 (list 0.0))))
		(if (= (length v2) 2) (setq v2 (append v2 (list 0.0))))
		(mapcar 'set '(xa ya za xb yb zb) (append v1 v2))
		(setq ang 
			(acos 
				(/
					(+ (* xa xb)(* ya yb)(* za zb)) 
					(* (sqrt (+(* xa xa)(* ya ya)(* za za)))(sqrt (+(* xb xb)(* yb yb)(* zb zb))))
				)
			)
		)
		(if (&amp;lt; zb za) (setq ang (- (* PI 2.0) ang)))
		ang
	)
	(setvar 'cmdecho 0)
	(setq bends '(0.0 11.25 22.5 45.0 60.0 90.0))
	(setq bends_count '((0.0 . 0) (11.25 . 0) (22.5 . 0) (45.0 . 0) (60.0 . 0) (90.0 . 0)))
	(setq ss (ssget '((0 . "LWPOLYLINE")(-4 . "&amp;gt;")(90 . 2))) j -1)
	(while (&amp;lt; (setq j (1+ j)) (sslength ss))
		(setq eo (vlax-ename-&amp;gt;vla-object (ssname ss j)))
		(cond 
			((= (vlax-get eo 'ObjectName) "AcDbPolyline") 
				(setq pts (pointlist2d(vlax-get eo 'Coordinates)))
				(cond
					((= (vlax-get eo 'Closed) -1)(setq pts (append (unique pts) (take 2 pts))))
					((&amp;lt;= (distance (vlax-curve-getStartPoint eo)(vlax-curve-getEndPoint eo)) 1e-8)(setq pts (append (unique pts) (cdr(take 2 pts)))))
				)
				(setq i 1)
				(while (&amp;lt; i (1- (length pts)))
					(setq p1 (nth (1- i) pts) p2 (nth i pts) p3 (nth (1+ i) pts) v1 (vect p1 p2) v2 (vect p2 p3) ang (rad_to_deg (-  PI (angles_two_vect v1 v2))))
					(if (&amp;gt; ang 90.0) (setq ang (- 180.0 ang)))
					(setq ang (car (vl-sort bends '(lambda (x y)(&amp;lt; (abs(- x ang))(abs(- y ang)))))))
					(setq cnt (1+(cdr (assoc ang bends_count))))
					(setq bends_count (subst (cons ang cnt) (assoc ang bends_count) bends_count))
					(setq i (1+ i))
				)	
			)
		)
	)
	(foreach ent bends_count
		(princ (strcat "\n" (rtos (car ent) 2 2) " --&amp;gt; " (itoa (cdr ent))))
	)
	(setvar 'cmdecho 1)
	(princ)
)&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>Wed, 29 Sep 2021 20:44:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10656203#M54555</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-29T20:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10656818#M54556</link>
      <description>&lt;P&gt;I used your code it's not working properly when I am selecting all the polylines the error appearing as a &lt;FONT color="#FF0000"&gt;too many&lt;/FONT&gt; &lt;FONT color="#FF0000"&gt;Arguments.&amp;nbsp; &lt;FONT color="#000000"&gt;can you provided me as a text at the bend locations, I will count the bends quantity with text object.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 04:35:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10656818#M54556</guid>
      <dc:creator>ishaq03</dc:creator>
      <dc:date>2021-09-30T04:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10656842#M54557</link>
      <description>&lt;P&gt;I've told in my post that you have to work in small batches. Something is causing an error and I don't know what. Take few polylines aside a and it works ok.&lt;/P&gt;&lt;P&gt;Also, take a time and create a write down all you want. Changes later today.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 05:03:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10656842#M54557</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-30T05:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10656919#M54558</link>
      <description>&lt;P&gt;Yes hak It's working fine if I will do few&amp;nbsp;&lt;SPAN&gt;polylines aside, And it's ok to me to count the bend quantities. But Please provide&amp;nbsp;me a code where&amp;nbsp; I can get the the angle text on the bend locations.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 06:03:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10656919#M54558</guid>
      <dc:creator>ishaq03</dc:creator>
      <dc:date>2021-09-30T06:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10656928#M54559</link>
      <description>I have to look into your drawing what causes an error. Code works OK with a lot of elements if they are created correctly. About showing text I'll work on it. Provide sample how you like the text to be created.</description>
      <pubDate>Thu, 30 Sep 2021 06:09:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10656928#M54559</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-30T06:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10657101#M54560</link>
      <description>&lt;P&gt;hak, check the attached Pic for angle text.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 07:47:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10657101#M54560</guid>
      <dc:creator>ishaq03</dc:creator>
      <dc:date>2021-09-30T07:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10657225#M54561</link>
      <description>&lt;P&gt;Do you want real angle values or rounded to 11.25 22.5 45 60 90?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 08:47:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10657225#M54561</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-30T08:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10657367#M54562</link>
      <description>&lt;P&gt;I don't&amp;nbsp; want the real values I need as a round values for 11.25 22.5 45 60&amp;amp;90 less than 11.25 ignore it please.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 09:45:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10657367#M54562</guid>
      <dc:creator>ishaq03</dc:creator>
      <dc:date>2021-09-30T09:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10657376#M54563</link>
      <description>&lt;P&gt;I asked this since in your sample they are not rounded. Also, what to do with small bending angles less then 5° ?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 09:53:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10657376#M54563</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-30T09:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10657463#M54564</link>
      <description>&lt;P&gt;&lt;SPAN&gt;less then 5° ignore it please no need to be text there.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 10:40:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10657463#M54564</guid>
      <dc:creator>ishaq03</dc:creator>
      <dc:date>2021-09-30T10:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10661389#M54565</link>
      <description>&lt;P&gt;Here is your code. Drawing repaired because of some&amp;nbsp; error in polylines. Attached corrected one with bend angles.&lt;/P&gt;&lt;P&gt;Previous code was OK.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:count-bends ( / 
	take pointlist2d deg_to_rad rad_to_deg vect unique asin acos angles_two_vect to_counter_clockwise
	bends bends_count ss i j eo pts p1 p2 p3 v1 v2 ang cnt
	)
	(defun *error* ()
		(setvar 'cmdecho 1)
		(princ)
	)
	(defun take (amount lst / ret)(repeat amount (setq ret (cons (car lst) (take (1- amount) (cdr lst))))))
	(defun pointlist2d (lst / ret) (while lst (setq	ret (cons (take 2 lst) ret) lst (cddr lst))) (reverse ret))
	(defun deg_to_rad (deg)(* PI (/ deg 180.0)))
	(defun rad_to_deg (rad)(* 180.0 (/ rad PI)))
	(defun vect (p1 p2)(mapcar '- p2 p1))
	(defun unique(lst)(if lst (cons (car lst) (Unique (vl-remove (car lst) (cdr lst))))))
	(defun asin (x)
	  (cond 
		((and(&amp;gt; x -1.0)(&amp;lt; x 1.0)) (atan (/ x (sqrt (- 1.0 (* x x))))))
		((= x -1.0) (* -1.0 (/ PI 2)))
		((= x  1) (/ PI 2))
	  )
	)
	(defun acos (x)
	  (cond 
		((and(&amp;gt;= x -1.0)(&amp;lt;= x 1.0)) (-(* PI 0.5) (asin x)))
	  )
	) 
	(defun angles_two_vect (v1 v2 / ang xa ya za xb yb zb) 
		(if (= (length v1) 2) (setq v1 (append v1 (list 0.0))))
		(if (= (length v2) 2) (setq v2 (append v2 (list 0.0))))
		(mapcar 'set '(xa ya za xb yb zb) (append v1 v2))
		(setq ang 
			(acos 
				(/
					(+ (* xa xb)(* ya yb)(* za zb)) 
					(* (sqrt (+(* xa xa)(* ya ya)(* za za)))(sqrt (+(* xb xb)(* yb yb)(* zb zb))))
				)
			)
		)
		(if (&amp;lt; zb za) (setq ang (- (* PI 2.0) ang)))
		ang
	)
	(setvar 'cmdecho 0)
	(setq bends '(0.0 11.25 22.5 45.0 60.0 90.0))
	(setq bends_count '((0 . 0) (11.25 . 0) (22.5 . 0) (45.0 . 0) (60.0 . 0) (90.0 . 0)))
	(setq ss (ssget '((0 . "LWPOLYLINE")(-4 . "&amp;gt;=")(90 . 3))) j -1)
	(cond 
		((and ss)
			(while (&amp;lt; (setq j (1+ j)) (sslength ss))
				(setq eo (vlax-ename-&amp;gt;vla-object (ssname ss j)))
				(cond 
					((= (vlax-get eo 'ObjectName) "AcDbPolyline") 
						(setq pts (pointlist2d(vlax-get eo 'Coordinates)))
						(cond
							((= (vlax-get eo 'Closed) -1)(setq pts (append (unique pts) (take 2 pts))))
							((&amp;lt;= (distance (vlax-curve-getStartPoint eo)(vlax-curve-getEndPoint eo)) 1e-8)(setq pts (append (unique pts) (last(take 2 pts)))))
						)
						(setq i 0)
						(while (&amp;lt; (setq i (1+ i)) (1- (length pts)))
							(setq p1 (nth (1- i) pts) p2 (nth i pts) p3 (nth (1+ i) pts) v1 (vect p1 p2) v2 (vect p2 p3) ang (rad_to_deg (-  PI (angles_two_vect v1 v2))))
							(if (&amp;gt; ang 90.0) (setq ang (- 180.0 ang)))
							(setq ang (car (vl-sort bends '(lambda (x y)(&amp;lt; (abs(- x ang))(abs(- y ang)))))))
							(if (&amp;gt; ang 0.0)
								(entmake
									(list
										(cons 0 "TEXT")
										(cons 100 "AcDbText")
										(cons 10 p2)
										(cons 40 4)
										(cons 1 (rtos ang 2 2))
										(cons 50 0)
										(cons 100 "AcDbText")
									)
								)								
							)
							(setq cnt (1+(cdr (assoc ang bends_count))))
							(setq bends_count (subst (cons ang cnt) (assoc ang bends_count) bends_count))
						)	
					)
				)
			)
			(setq bends_count (cdr bends_count))
			(foreach ent bends_count
				(princ (strcat "\n" (rtos (car ent) 2 2) " --&amp;gt; " (itoa (cdr ent))))
			)
		)
	)
	(setvar 'cmdecho 1)
	(princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 19:47:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10661389#M54565</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-10-01T19:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10661801#M54566</link>
      <description>&lt;P&gt;Thanks hak it's working fine as per my need.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Oct 2021 04:13:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/10661801#M54566</guid>
      <dc:creator>ishaq03</dc:creator>
      <dc:date>2021-10-02T04:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/13418576#M54567</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5530556"&gt;@hak_vz&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3775760"&gt;@ishaq03&lt;/a&gt;&amp;nbsp;@&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908" target="_self"&gt;&lt;SPAN class=""&gt;Sea-Haven&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please modify the same lisp?&lt;/P&gt;&lt;P&gt;I have change from Decimal to "DDMMSS", but angle inserting wrong in "SS".&lt;/P&gt;&lt;P&gt;Image is attached for your reference.&lt;/P&gt;&lt;P&gt;Red color by lisp &amp;amp; angle by manually both are different...&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hiraram_prajapati_0-1744287437620.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1487938i89095AF1732753EA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hiraram_prajapati_0-1744287437620.png" alt="hiraram_prajapati_0-1744287437620.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 12:20:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/13418576#M54567</guid>
      <dc:creator>hiraram_prajapati</dc:creator>
      <dc:date>2025-04-10T12:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/13419607#M54568</link>
      <description>&lt;P&gt;It's overkill to convert an angle to a text string and from there to a decimal value and from there back to a string in DMS format:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt; ;; Round to 2 decimals and convert to DMS&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(setq ang (atof (rtos ang 2 2)))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(setq dms-str (format_dms ang))&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Instead, try getting it directly into DMS format, substituting ° for the d:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;(setq dms-str (vl-string-subst "°" "d" &lt;FONT color="#0000FF"&gt;(angtos ang 1 4)&lt;/FONT&gt;))&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 17:41:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/13419607#M54568</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2025-04-10T17:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/13420165#M54569</link>
      <description>&lt;P&gt;Good answer&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;,&amp;nbsp;1 second of bearing. A rtos 2 2 would give an answer of "0".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(/ 1. 3600)&lt;BR /&gt;0.000277777777777778&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 00:37:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/13420165#M54569</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2025-04-11T00:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/13420403#M54570</link>
      <description>&lt;P&gt;Can you please update the lisp and sent to me, i am not able to update...please&amp;nbsp;&lt;/P&gt;&lt;P&gt;Value not correct coming.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hiraram_prajapati_0-1744348284662.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1488225i1BE12726E0F96398/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hiraram_prajapati_0-1744348284662.png" alt="hiraram_prajapati_0-1744348284662.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 05:12:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/13420403#M54570</guid>
      <dc:creator>hiraram_prajapati</dc:creator>
      <dc:date>2025-04-11T05:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/13420868#M54571</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... A rtos 2 2 would give an answer of "0".&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can have it give an answer of "0.00" if that's what you want, with an appropriate setting of the &lt;STRONG&gt;DIMZIN&lt;/STRONG&gt; System Variable.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 10:21:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/13420868#M54571</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2025-04-11T10:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Bend Angles</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/13420925#M54572</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15946197"&gt;@hiraram_prajapati&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Can you please update the lisp and sent to me, i am not able to update.....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Before I try, looking more closely I see your&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;(format_dms)&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;function is to convert &lt;EM&gt;decimal degrees&lt;/EM&gt;, whereas I had assumed the 'ang' argument would be in &lt;EM&gt;radians&lt;/EM&gt;&amp;nbsp;as is so typically done.&amp;nbsp; I suggest sticking with radians all the way to the point where you need the text string.&amp;nbsp; Try replacing this:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; ang (rad_to_deg (- pi (angles_two_vect v1 v2)))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(if (&amp;gt; ang 90.0) (setq ang (- 180.0 ang)))&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;with this:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;...&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; ang (- pi (angles_two_vect v1 v2))&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;(if (&amp;gt; ang (/ pi 2)) (setq ang (- pi ang)))&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;...&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;[and also use my earlier suggested change].&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or instead, maybe simply change my earlier suggestion to this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;(setq dms-str (vl-string-subst "°" "d"&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;(angtos &lt;FONT color="#FF0000"&gt;(cvunit&lt;/FONT&gt; ang &lt;FONT color="#FF0000"&gt;"degree" "radian")&lt;/FONT&gt; 1 4)&lt;/FONT&gt;))&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 11:04:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bend-angles/m-p/13420925#M54572</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2025-04-11T11:04:09Z</dc:date>
    </item>
  </channel>
</rss>

