<?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: Text rotation with UCS view in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/text-rotation-with-ucs-view/m-p/12816307#M13237</link>
    <description>&lt;P&gt;For getting the correct text insertion point, replace this line:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;  ;; Extract the position of the selected entity
  (setq pos (cdr (assoc 10 entity-data)))&lt;/LI-CODE&gt;&lt;P&gt;With this line:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;  ;; Extract the position of the selected entity
  (setq pos (trans (cdr (assoc 10 entity-data)) 0 1)) ; translate from wcs to ucs&lt;/LI-CODE&gt;&lt;P&gt;For Text Rotation, add after this line:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;  ;; Add the specified text at the new position
  (command "TEXT" new-pos "0" text)&lt;/LI-CODE&gt;&lt;P&gt;The following:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;  ;; add rotation match
  (setpropertyvalue (entlast) "Rotation" (getpropertyvalue entity "Rotation"))&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 03 Jun 2024 23:11:47 GMT</pubDate>
    <dc:creator>paullimapa</dc:creator>
    <dc:date>2024-06-03T23:11:47Z</dc:date>
    <item>
      <title>Text rotation with UCS view</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/text-rotation-with-ucs-view/m-p/12816159#M13236</link>
      <description>&lt;P&gt;Ive got this lisp that adds text to other pieces of text, mtext or multileaders. it only works in UCS-World, if not in world, the text goes off to space. if there is a view rotation from world view, the text is rotated to be world-oriented. is there a way around this? im looking to have it be placed horizontally where i want the text no matter the view. any other ideas on this to make it better are appreciated.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun common-function ()
  (princ)
  ;; Prompt the user to select the entity (TEXT, MTEXT, or MULTILEADER)
  (setq entity (car (entsel "SELECT ENTITY (TEXT, MTEXT, OR MULTILEADER): ")))
  (setq entity-data (entget entity))

  ;; Extract the position of the selected entity
  (setq pos (cdr (assoc 10 entity-data)))

  ;; Determine the type of entity and set offsets accordingly
  (cond
    ((= (cdr (assoc 0 entity-data)) "TEXT")
     (setq x-offset 0.0)  ;; X offset for TEXT
     (setq y-offset -4.25) ;; Y offset for TEXT
    )
    ((= (cdr (assoc 0 entity-data)) "MTEXT")
     (setq x-offset 0.0)  ;; X offset for MTEXT
     (setq y-offset -6.65) ;; Y offset for MTEXT
    )
    ((= (cdr (assoc 0 entity-data)) "MULTILEADER")
     (setq x-offset 1.3)  ;; X offset for MULTILEADER
     (setq y-offset -5.65) ;; Y offset for MULTILEADER
    )
    (t
     (princ "Selected entity is neither TEXT, MTEXT, nor MULTILEADER.")
     (exit)
    )
  )

  ;; Prompt the user to choose the text to be added
  (setq choice (getstring "\nChoose the text to add (1: TO BE REMOVED, 2: TO REMAIN): "))
  (cond
    ((= choice "1") (setq text "TO BE REMOVED"))
    ((= choice "2") (setq text "TO REMAIN"))
    (t (princ "Invalid choice.") (exit))
  )

  ;; Calculate the new position for the text
  (setq new-pos (list (+ (car pos) x-offset) (+ (cadr pos) y-offset)))

  ;; Add the specified text at the new position
  (command "TEXT" new-pos "0" text)

  (princ)
)

(defun C:DRT ()
  (common-function))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 03 Jun 2024 21:39:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/text-rotation-with-ucs-view/m-p/12816159#M13236</guid>
      <dc:creator>venturini.anthony</dc:creator>
      <dc:date>2024-06-03T21:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Text rotation with UCS view</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/text-rotation-with-ucs-view/m-p/12816307#M13237</link>
      <description>&lt;P&gt;For getting the correct text insertion point, replace this line:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;  ;; Extract the position of the selected entity
  (setq pos (cdr (assoc 10 entity-data)))&lt;/LI-CODE&gt;&lt;P&gt;With this line:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;  ;; Extract the position of the selected entity
  (setq pos (trans (cdr (assoc 10 entity-data)) 0 1)) ; translate from wcs to ucs&lt;/LI-CODE&gt;&lt;P&gt;For Text Rotation, add after this line:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;  ;; Add the specified text at the new position
  (command "TEXT" new-pos "0" text)&lt;/LI-CODE&gt;&lt;P&gt;The following:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;  ;; add rotation match
  (setpropertyvalue (entlast) "Rotation" (getpropertyvalue entity "Rotation"))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 03 Jun 2024 23:11:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/text-rotation-with-ucs-view/m-p/12816307#M13237</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-06-03T23:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Text rotation with UCS view</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/text-rotation-with-ucs-view/m-p/12818602#M13238</link>
      <description>&lt;P&gt;that worked for the text and multileader, but mtext is still rotated, very strange. is there a better way to approach this to try and achieve something similar?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my ultimate goal would be to have it work on left &amp;amp; right facing multileader &amp;amp; multiline mtext/leaders with any justification. I wasn't able to get the text to be below the bounding box, just below the insertion point.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2024 19:58:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/text-rotation-with-ucs-view/m-p/12818602#M13238</guid>
      <dc:creator>venturini.anthony</dc:creator>
      <dc:date>2024-06-04T19:58:37Z</dc:date>
    </item>
  </channel>
</rss>

