<?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: Rotate text according to ucs angle in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664590#M164451</link>
    <description>&lt;P&gt;Hello, how are you?&lt;BR /&gt;I just want all the text I select to be horizontal and read from left to right.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 02:03:13 GMT</pubDate>
    <dc:creator>carlos_m_gil_p</dc:creator>
    <dc:date>2025-06-04T02:03:13Z</dc:date>
    <item>
      <title>Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13660386#M164389</link>
      <description>&lt;P&gt;Hello, how are you?&lt;BR /&gt;I wanted to ask you a favor to improve a Lisp project I'm working on.&lt;BR /&gt;I've used the Plant command to rotate the screen according to the UCS.&lt;BR /&gt;I need to select some text so it appears horizontal, according to the UCS.&lt;BR /&gt;But I don't understand why it works with some text and not with others.&lt;BR /&gt;Here's a DWG file where I'm testing and the code I wrote.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:xxx (/ sel i e ang) 
  ;
  (setq sel (vl-catch-all-apply 'ssget (list '((0 . "MTEXT,TEXT")))))
  ;
  ; (setq ang (angle '(0 0 0) '(1 0 0)))
  (setq ang (angle (trans '(0.0 0.0 0.0) 1 0) (trans '(1.0 0.0 0.0) 1 0)))
  ;
  (repeat (setq i (sslength sel)) 
    (setq e (entget (ssname sel (setq i (1- i)))))
    (entmod (subst (cons 50 ang) (assoc 50 e) e)))
  ;
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I'd appreciate any help you can give me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jun 2025 23:31:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13660386#M164389</guid>
      <dc:creator>carlos_m_gil_p</dc:creator>
      <dc:date>2025-06-01T23:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13660454#M164391</link>
      <description>&lt;P&gt;Have you looked at the 210 dxf code it may do what you want not tested.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(210 0.0 0.0 -1.0) is text at 0.0 angle in world UCS&lt;/P&gt;&lt;P&gt;(210 0.0 -1.0 0.0) is text rotated in 3d 90 about the X axis&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 01:36:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13660454#M164391</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2025-06-02T01:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13660476#M164392</link>
      <description>&lt;P&gt;Hi bro, thanks for responding.&lt;BR /&gt;I just checked the 210 code, but all the texts are the same.&lt;BR /&gt;(210 0.0 0.0 1.0)&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 02:17:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13660476#M164392</guid>
      <dc:creator>carlos_m_gil_p</dc:creator>
      <dc:date>2025-06-02T02:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13660631#M164395</link>
      <description>&lt;P&gt;post a sample dwg and point out the text that do work vs text that don't&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 05:36:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13660631#M164395</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2025-06-02T05:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13660733#M164396</link>
      <description>&lt;P&gt;You can't treat MTEXT and TEXT the same way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While TEXT behaves as expected, the angle is always stored according to WCS; the MTEXT angle is, for some reason, stored according to UCS.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 06:44:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13660733#M164396</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2025-06-02T06:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13662628#M164415</link>
      <description>&lt;P&gt;I may be going down the wrong path, Having another look at this for text &amp;amp; mtext.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The BC is in world&amp;nbsp;(210 0.0 0.0 1.0)&lt;/P&gt;&lt;P&gt;The DEF is in a ucs of 90 rotated about X (210 0.0 -1.0 0.0)&lt;/P&gt;&lt;P&gt;Using Mtext&lt;/P&gt;&lt;P&gt;The qwert is world&amp;nbsp;(210 0.0 0.0 1.0)&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ASDF is UCS&amp;nbsp;(210 0.0 -1.0 0.0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;View in 3D&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SeaHaven_1-1748910305943.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1539547i677444D8A91F92E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SeaHaven_1-1748910305943.png" alt="SeaHaven_1-1748910305943.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>Tue, 03 Jun 2025 00:26:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13662628#M164415</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2025-06-03T00:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664247#M164445</link>
      <description>&lt;P&gt;hey you there,&lt;/P&gt;&lt;P&gt;check the following.&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:rot (/ rotation)
	(mapcar '(lambda (m_text) (if (= "AcDbText" (vla-get-objectname m_text))
				    (setq rotation (- (angle '(0 0 0) (getvar 'ucsxdir)) (vla-get-rotation m_text)))
				    (setq rotation (- (angle '(0 0 0) '(1 0 0)) (vla-get-rotation m_text)))
				  )
		   		  (vla-rotate m_text (vla-get-insertionpoint m_text) rotation)
		 )
  		 (mapcar 'vlax-ename-&amp;gt;vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget '((0 . "MTEXT,TEXT")))))))
	)
	(princ)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 Jun 2025 19:56:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664247#M164445</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2025-06-03T19:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664590#M164451</link>
      <description>&lt;P&gt;Hello, how are you?&lt;BR /&gt;I just want all the text I select to be horizontal and read from left to right.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 02:03:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664590#M164451</guid>
      <dc:creator>carlos_m_gil_p</dc:creator>
      <dc:date>2025-06-04T02:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664592#M164452</link>
      <description>&lt;P&gt;Hello, how are you?&lt;BR /&gt;I'm just realizing right now that they don't work the same.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 02:04:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664592#M164452</guid>
      <dc:creator>carlos_m_gil_p</dc:creator>
      <dc:date>2025-06-04T02:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664593#M164453</link>
      <description>&lt;P&gt;Hello, how are you?&lt;BR /&gt;This isn't what I'm looking for right now. As I mentioned above, I just want all text and mtext to be horizontal.&lt;BR /&gt;It doesn't matter if I have the screen or the UCs rotated.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 02:05:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664593#M164453</guid>
      <dc:creator>carlos_m_gil_p</dc:creator>
      <dc:date>2025-06-04T02:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664598#M164454</link>
      <description>&lt;P&gt;Hi, how are you?&lt;BR /&gt;I just ran the tests, and it works great in this dwg file I posted.&lt;BR /&gt;But I ran a new test where I set the entire screen to normal and rotated it 90 degrees.&lt;BR /&gt;But when I use your function again, the text remains vertical.&lt;BR /&gt;Is there a way to improve that?&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="Captura de pantalla 2025-06-03 220533.jpg" style="width: 282px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1539958i4A13EC48901327D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Captura de pantalla 2025-06-03 220533.jpg" alt="Captura de pantalla 2025-06-03 220533.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I turned it from here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attaching a new dwg where I am doing the new tests.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 02:12:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664598#M164454</guid>
      <dc:creator>carlos_m_gil_p</dc:creator>
      <dc:date>2025-06-04T02:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664610#M164455</link>
      <description>&lt;P&gt;Hey guys, I just found a routine from Mr. Lee_Mac, and it works fine.&lt;BR /&gt;And with lee_mac's permission, I wonder if there's a way to modify the getorient function.&lt;BR /&gt;It's possible to make it get the angle itself so it doesn't have to select two points on the screen.&lt;BR /&gt;In the tests I've run, getorient determines the direction of the text, so I always select two points horizontally from left to right, and all the text always remains horizontal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:xxx (/ ss ang e eLst xAng e) 
  ; Lee Mac  ~  16.04.10[/i]
  (if 
    (and 
      (setq ss (ssget "_:L" 
                      '((-4 . "&amp;lt;OR")
                        (0 . "*TEXT,ATTDEF")
                        (-4 . "&amp;lt;AND")
                        (0 . "INSERT")
                        (66 . 1)
                        (-4 . "AND&amp;gt;")
                        (-4 . "OR&amp;gt;"))))
      (setq ang (getorient "\nSpecify Angle: ")))
    ((lambda (i) 
       (setq xAng (angle '(0.0 0.0 0.0) (trans (getvar 'UCSXDIR) 0 (trans '(0.0 0.0 1.0) 1 0 t))))
       (while (setq e (ssname ss (setq i (1+ i)))) 
         (cond 
           ((eq "INSERT" (cdr (assoc 0 (setq eLst (entget e)))))
            (while (not (eq "SEQEND" (cdr (assoc 0 (setq eLst (entget (setq e (entnext e)))))))) 
              (entmod (subst (cons 50 (+ ang xAng)) (assoc 50 eLst) eLst))))
           ((entmod (subst (cons 50 (if (eq "MTEXT" (cdr (assoc 0 eLst))) ang (+ ang xAng))) (assoc 50 eLst) eLst)))))) 
      -1))
  (princ))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 02:31:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664610#M164455</guid>
      <dc:creator>carlos_m_gil_p</dc:creator>
      <dc:date>2025-06-04T02:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664613#M164456</link>
      <description>&lt;P&gt;Hey guys, I just found a routine from&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/569456"&gt;@Lee_Mac&lt;/a&gt;&amp;nbsp;and it works fine.&lt;BR /&gt;And with Lee_Mac's permission, I wonder if there's a way to modify the getorient function.&lt;BR /&gt;It's possible to make it get the angle itself so it doesn't have to select two points on the screen.&lt;BR /&gt;In the tests I've run, getorient determines the direction of the text, so I always select two points horizontally from left to right, and all the text always remains horizontal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:xxx (/ ss ang e eLst xAng e) 
  ; Lee Mac  ~  16.04.10[/i]
  (if 
    (and 
      (setq ss (ssget "_:L" 
                      '((-4 . "&amp;lt;OR")
                        (0 . "*TEXT,ATTDEF")
                        (-4 . "&amp;lt;AND")
                        (0 . "INSERT")
                        (66 . 1)
                        (-4 . "AND&amp;gt;")
                        (-4 . "OR&amp;gt;"))))
      (setq ang (getorient "\nSpecify Angle: ")))
    ((lambda (i) 
       (setq xAng (angle '(0.0 0.0 0.0) (trans (getvar 'UCSXDIR) 0 (trans '(0.0 0.0 1.0) 1 0 t))))
       (while (setq e (ssname ss (setq i (1+ i)))) 
         (cond 
           ((eq "INSERT" (cdr (assoc 0 (setq eLst (entget e)))))
            (while (not (eq "SEQEND" (cdr (assoc 0 (setq eLst (entget (setq e (entnext e)))))))) 
              (entmod (subst (cons 50 (+ ang xAng)) (assoc 50 eLst) eLst))))
           ((entmod (subst (cons 50 (if (eq "MTEXT" (cdr (assoc 0 eLst))) ang (+ ang xAng))) (assoc 50 eLst) eLst)))))) 
      -1))
  (princ))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 02:35:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664613#M164456</guid>
      <dc:creator>carlos_m_gil_p</dc:creator>
      <dc:date>2025-06-04T02:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate text according to ucs angle</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664830#M164457</link>
      <description>&lt;P&gt;hey, rot custom command will rotate {m}texts to align with x axle of the current ucs, which in your very case of rtext2 drawing is pretty vertical. so they surely will stay vertical.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 06:27:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-text-according-to-ucs-angle/m-p/13664830#M164457</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2025-06-04T06:27:05Z</dc:date>
    </item>
  </channel>
</rss>

