<?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 Change text to mtxt, add annotative scales LISP in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342683#M22384</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am exporting contour xrefs from a 3d program which spits out the labels as text. I have created a lisp which converts this text to mtext, adds a background mask, and justifys all the text to middle centre and this works great. What i have also created is a simple script which turns on ANNOAUTOSCALE then cycles through the CANNOSCALE of certain scales which essentially gives me somewhat automated annotative text scales.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The manual things i have to do&lt;/P&gt;&lt;P&gt;1. open and select all text to make it annotative&lt;/P&gt;&lt;P&gt;2. run the script which gives annotation scales to my text&lt;/P&gt;&lt;P&gt;3. run the lisp which turns all the txt to mtxt etc&lt;/P&gt;&lt;P&gt;4. change the background mask to 1.1 not 1.5 as that is set as the default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Information im looking for.&lt;/P&gt;&lt;P&gt;1. is it possible to set the text objects to annotative? alternatively could set the a textsyle which is already annotative?&lt;/P&gt;&lt;P&gt;2. is it possible to change the background mask border offset via lisp? (have googled alot but no dice)&lt;/P&gt;&lt;P&gt;2. is it possible to add my lisp and script together to run all at once&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lisp txttomtext code&lt;/P&gt;&lt;P&gt;(defun C:ContourExport (/ ss1 en n)&lt;/P&gt;&lt;P&gt;;; Select all Text objects&lt;BR /&gt;(setq ss1 (ssget "_X" (list (cons 0 "TEXT"))))&lt;/P&gt;&lt;P&gt;(setq i -1)&lt;BR /&gt;(if ss1&lt;BR /&gt;(repeat (sslength ss1)&lt;BR /&gt;(setq elist (cdr (assoc -1 (entget (ssname ss1 (setq i (1+ i)))))))&lt;BR /&gt;(command "TXT2MTXT" elist "")&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;;; Select all MText objects&lt;BR /&gt;(setq ss1 (ssget "_X" (list (cons 0 "MTEXT"))))&lt;/P&gt;&lt;P&gt;(if ss1&lt;BR /&gt;(progn&lt;BR /&gt;(setq n (sslength ss1))&lt;BR /&gt;(repeat n&lt;BR /&gt;(setq n (1- n))&lt;BR /&gt;(setq en (vlax-ename-&amp;gt;vla-object (ssname ss1 n)))&lt;BR /&gt;(if (vlax-property-available-p en 'BackgroundFill)&lt;BR /&gt;(vlax-put en 'BackgroundFill 1)&lt;BR /&gt;)&lt;BR /&gt;(vlax-put en 'AttachmentPoint 5) ; Set the attachment point to middle center&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(prompt "\nNo MText found.")&lt;BR /&gt;)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Script code&lt;/P&gt;&lt;P&gt;ANNOAUTOSCALE 1&lt;/P&gt;&lt;P&gt;CANNOSCALE "1:500 (M)"&lt;BR /&gt;CANNOSCALE "1:2000 (M)"&lt;BR /&gt;CANNOSCALE "Metres 1:1000"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Oct 2023 08:43:34 GMT</pubDate>
    <dc:creator>Kate.RobinsonR9FXS</dc:creator>
    <dc:date>2023-10-31T08:43:34Z</dc:date>
    <item>
      <title>Change text to mtxt, add annotative scales LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342683#M22384</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am exporting contour xrefs from a 3d program which spits out the labels as text. I have created a lisp which converts this text to mtext, adds a background mask, and justifys all the text to middle centre and this works great. What i have also created is a simple script which turns on ANNOAUTOSCALE then cycles through the CANNOSCALE of certain scales which essentially gives me somewhat automated annotative text scales.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The manual things i have to do&lt;/P&gt;&lt;P&gt;1. open and select all text to make it annotative&lt;/P&gt;&lt;P&gt;2. run the script which gives annotation scales to my text&lt;/P&gt;&lt;P&gt;3. run the lisp which turns all the txt to mtxt etc&lt;/P&gt;&lt;P&gt;4. change the background mask to 1.1 not 1.5 as that is set as the default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Information im looking for.&lt;/P&gt;&lt;P&gt;1. is it possible to set the text objects to annotative? alternatively could set the a textsyle which is already annotative?&lt;/P&gt;&lt;P&gt;2. is it possible to change the background mask border offset via lisp? (have googled alot but no dice)&lt;/P&gt;&lt;P&gt;2. is it possible to add my lisp and script together to run all at once&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lisp txttomtext code&lt;/P&gt;&lt;P&gt;(defun C:ContourExport (/ ss1 en n)&lt;/P&gt;&lt;P&gt;;; Select all Text objects&lt;BR /&gt;(setq ss1 (ssget "_X" (list (cons 0 "TEXT"))))&lt;/P&gt;&lt;P&gt;(setq i -1)&lt;BR /&gt;(if ss1&lt;BR /&gt;(repeat (sslength ss1)&lt;BR /&gt;(setq elist (cdr (assoc -1 (entget (ssname ss1 (setq i (1+ i)))))))&lt;BR /&gt;(command "TXT2MTXT" elist "")&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;;; Select all MText objects&lt;BR /&gt;(setq ss1 (ssget "_X" (list (cons 0 "MTEXT"))))&lt;/P&gt;&lt;P&gt;(if ss1&lt;BR /&gt;(progn&lt;BR /&gt;(setq n (sslength ss1))&lt;BR /&gt;(repeat n&lt;BR /&gt;(setq n (1- n))&lt;BR /&gt;(setq en (vlax-ename-&amp;gt;vla-object (ssname ss1 n)))&lt;BR /&gt;(if (vlax-property-available-p en 'BackgroundFill)&lt;BR /&gt;(vlax-put en 'BackgroundFill 1)&lt;BR /&gt;)&lt;BR /&gt;(vlax-put en 'AttachmentPoint 5) ; Set the attachment point to middle center&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(prompt "\nNo MText found.")&lt;BR /&gt;)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Script code&lt;/P&gt;&lt;P&gt;ANNOAUTOSCALE 1&lt;/P&gt;&lt;P&gt;CANNOSCALE "1:500 (M)"&lt;BR /&gt;CANNOSCALE "1:2000 (M)"&lt;BR /&gt;CANNOSCALE "Metres 1:1000"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 08:43:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342683#M22384</guid>
      <dc:creator>Kate.RobinsonR9FXS</dc:creator>
      <dc:date>2023-10-31T08:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Change text to mtxt, add annotative scales LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342745#M22385</link>
      <description>&lt;P&gt;Post 2 dwgs, initial state and desired.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 08:36:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342745#M22385</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-10-31T08:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Change text to mtxt, add annotative scales LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342780#M22386</link>
      <description>&lt;P&gt;done&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 08:43:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342780#M22386</guid>
      <dc:creator>Kate.RobinsonR9FXS</dc:creator>
      <dc:date>2023-10-31T08:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Change text to mtxt, add annotative scales LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342806#M22387</link>
      <description>&lt;P&gt;Those annotative styles, can't they be part of the dwt you're exporting to?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 08:55:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342806#M22387</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-10-31T08:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Change text to mtxt, add annotative scales LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342829#M22388</link>
      <description>&lt;P&gt;Do you mean the text styles? they are apart of the dwt but i can't export to those specific styles if that whats you mean&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KateRobinsonR9FXS_0-1698743458571.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1286083iE72E89A17B69C0CD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KateRobinsonR9FXS_0-1698743458571.png" alt="KateRobinsonR9FXS_0-1698743458571.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;ArialNarrow2.5 is the anno Texstyle i would put them on after export.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 09:11:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342829#M22388</guid>
      <dc:creator>Kate.RobinsonR9FXS</dc:creator>
      <dc:date>2023-10-31T09:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Change text to mtxt, add annotative scales LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342950#M22389</link>
      <description>&lt;P&gt;Ok, I see, but 1:2000 scale is not part of it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

(defun c:CountourExportsTextFix ( / s i e ts)

  (if (setq s (ssget "_X" '((0 . "TEXT"))))
    (progn
      (setvar '*txt2mtxtcombinemtext 0)
      (command "_.TXT2MTXT" s "")))

  (setq ts (tblobjname "Style" "ArialNarrow2.5"))
  
  (if (setq s (ssget "_X" '((0 . "MTEXT"))))
    (repeat (setq i (sslength s))
      (setq e (ssname s (setq i (1- i))))
;      (setpropertyvalue e "Attachment" 5) it does not change the point
      (vlax-put (vlax-ename-&amp;gt;vla-object e) 'AttachmentPoint 5)
      (setpropertyvalue e "BackgroundFill" 1)
      (setpropertyvalue e "UseBackgroundColor" 1)
      (setpropertyvalue e "BackgroundTransparency" 0)      
      (setpropertyvalue e "BackgroundScaleFactor" 1.1)
      (setpropertyvalue e "Annotative" 1)
      (and ts (setpropertyvalue e "TextStyleId" ts))
      ))

  (setvar 'ANNOAUTOSCALE 1)
  (setvar 'CANNOSCALE "1:500 (M)")
  (command "_.-scalelistedit" "_d" "1:2000 (M)" "_add" "1:2000 (M)" "1:2" "_e")
  (setvar 'CANNOSCALE "1:2000 (M)")
  (setvar 'CANNOSCALE "Metres 1:1000")
  (setvar 'ANNOAUTOSCALE 0)
  
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 09:54:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342950#M22389</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-10-31T09:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Change text to mtxt, add annotative scales LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342967#M22390</link>
      <description>&lt;P&gt;That worked a treat! Thanks heaps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The anno scales can definitely be added to the dwt, not sure why 1:2000 was missing.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 10:04:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-text-to-mtxt-add-annotative-scales-lisp/m-p/12342967#M22390</guid>
      <dc:creator>Kate.RobinsonR9FXS</dc:creator>
      <dc:date>2023-10-31T10:04:58Z</dc:date>
    </item>
  </channel>
</rss>

