<?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: Mtext Formatting In A Field in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5861132#M137615</link>
    <description>Thank you hm! Yes, the blue is setup as bylayer.&lt;BR /&gt;&lt;BR /&gt;I will give these ideas a try and let you and rk know if it worked or not.&lt;BR /&gt;&lt;BR /&gt;Thank you both, again!</description>
    <pubDate>Wed, 14 Oct 2015 14:25:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-10-14T14:25:18Z</dc:date>
    <item>
      <title>Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5858938#M137611</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am hoping someone here can help with this problem.&amp;nbsp; I am trying to have some text that is stored in a variable output in a field that should be&amp;nbsp;a different color from rest of the text.&amp;nbsp; I have looked high and low in multilple forums but have not found the exact the solution I need.&amp;nbsp; I have stubled upon the Mtext formatting codes, I have seen a few examples,&amp;nbsp;but when I try to replicate it does not work for me.&amp;nbsp; I don't understand how they&amp;nbsp;are to be used in a LISP routine.&amp;nbsp; I&amp;nbsp;know how to change the color of the text the usual way, I would think there is a way to code it.&amp;nbsp; Below is a screen capture of what I am hoping to accomplish, currently all the text is blue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG width="236" height="139" title="Capture.PNG" alt="Capture.PNG" src="https://forums.autodesk.com/t5/image/serverpage/image-id/194164i09439F4E221A3443/image-size/medium?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the line of code that produces the top two lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(setq dwg (strcat "DWG. PER CUST E-MAIL:" (chr 10) (vl-filename-base (getvar "dwgname")) ".dxf" (chr 10) "DWG#: " dwg2))&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope I have explained this well enough to be understood.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your time and attention!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2015 11:54:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5858938#M137611</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-13T11:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5858958#M137612</link>
      <description>&lt;P&gt;Are you asking how to set the colors of the partial strings inside the mtext block?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-cmdf ".mtext" (getpoint "\nPick Point") "_W" 0.0
	 (strcat "\\C6;DWG. PER CUST E-MAIL:\\P80721354_-.DXF\\P\\C5;REV: NONE\\P1 1/2"
		 (CHR 34)
		 " 50 HSLA\\P19"
		 (CHR 34)
		 " B.EA\\P12.028# EA.\\PJK\\P9/25/15")
	 "")&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Oct 2015 12:06:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5858958#M137612</guid>
      <dc:creator>rkmcswain</dc:creator>
      <dc:date>2015-10-13T12:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5859265#M137613</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am hoping someone here can help with this problem.&amp;nbsp; I am trying to have some text that is stored in a variable output in a field that should be&amp;nbsp;a different color from rest of the text.&amp;nbsp; I have looked high and low in multilple forums but have not found the exact the solution I need.&amp;nbsp; I have stubled upon the Mtext formatting codes, I have seen a few examples,&amp;nbsp;but when I try to replicate it does not work for me.&amp;nbsp; I don't understand how they&amp;nbsp;are to be used in a LISP routine.&amp;nbsp; I&amp;nbsp;know how to change the color of the text the usual way, I would think there is a way to code it.&amp;nbsp; Below is a screen capture of what I am hoping to accomplish, currently all the text is blue:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG width="236" height="139" title="Capture.PNG" alt="Capture.PNG" src="https://forums.autodesk.com/t5/image/serverpage/image-id/194164i09439F4E221A3443/image-size/medium?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the line of code that produces the top two lines:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(setq dwg (strcat "DWG. PER CUST E-MAIL:" (chr 10) (vl-filename-base (getvar "dwgname")) ".dxf" (chr 10) "DWG#: " dwg2))&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope I have explained this well enough to be understood.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance for your time and attention!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi Joe,&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;in addition&lt;/SPAN&gt; to RK &lt;SPAN class="hps"&gt;advices&lt;/SPAN&gt;, and if the 'blue' is bylayer, you'll only have to override the color for color 6...&lt;/P&gt;
&lt;P&gt;ex.&lt;/P&gt;
&lt;PRE&gt;(setq dwg (strcat "{\\C6;DWG. PER CUST E-MAIL:" "\\P" (vl-filename-base (getvar "dwgname")) ".dxf}" (chr 10) dwg2 ))&lt;/PRE&gt;
&lt;P&gt;sorry but I did remove the "DWG#: "....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2015 14:43:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5859265#M137613</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-10-13T14:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5861127#M137614</link>
      <description>Thank you for responding rk! No, I am just needing the top two lines changed. I should've included the whole routine so that you could see what is generating the text.&lt;BR /&gt;&lt;BR /&gt;Thanks again!</description>
      <pubDate>Wed, 14 Oct 2015 14:21:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5861127#M137614</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-14T14:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5861132#M137615</link>
      <description>Thank you hm! Yes, the blue is setup as bylayer.&lt;BR /&gt;&lt;BR /&gt;I will give these ideas a try and let you and rk know if it worked or not.&lt;BR /&gt;&lt;BR /&gt;Thank you both, again!</description>
      <pubDate>Wed, 14 Oct 2015 14:25:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5861132#M137615</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-14T14:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5861292#M137616</link>
      <description>&lt;P&gt;hmsilva,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry to say the code didn't work.&amp;nbsp; Below is a screenshot of the output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG title="Capture.PNG" alt="Capture.PNG" src="https://forums.autodesk.com/t5/image/serverpage/image-id/194422i8C6F74C76B3B3F0B/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;PRE&gt;(setq dwg (strcat "{\\C6;DWG. PER CUST E-MAIL:" "\\P" (vl-filename-base (getvar "dwgname")) ".dxf}" "\\P" "DWG#: " dwg2))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems the mtext formatting&amp;nbsp;code&amp;nbsp;is being ignored.&amp;nbsp;&amp;nbsp;Thank you for trying.&amp;nbsp; Do you have&amp;nbsp;any ideas as to why the mtext formatting is being ignored?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 15:14:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5861292#M137616</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-14T15:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5861404#M137617</link>
      <description>&lt;P&gt;rkmcswain,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your code worked when I tried it as it's own program.&amp;nbsp; When I tried to incorporate it into my code, it worked the same as Henrique's.&amp;nbsp; I will attach the entire routine I am using.&amp;nbsp; There&amp;nbsp;are only 4 other lines that would need to have the mtext formatting.&amp;nbsp; I am certain as you&amp;nbsp;read it, there will be some wincing.&amp;nbsp; It doesn't look very good, but it does give me the result's I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 15:49:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5861404#M137617</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-14T15:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5862650#M137618</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;hmsilva,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry to say the code didn't work.&amp;nbsp; Below is a screenshot of the output:&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;It seems the mtext formatting&amp;nbsp;code&amp;nbsp;is being ignored.&amp;nbsp;&amp;nbsp;Thank you for trying.&amp;nbsp; Do you have&amp;nbsp;any ideas as to why the mtext formatting is being ignored?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi Joe,&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;unfortunately&lt;/SPAN&gt;, &lt;SPAN class="hps"&gt;it seems&lt;/SPAN&gt; that 'fields' &lt;SPAN class="hps alt-edited"&gt;evaluates&lt;/SPAN&gt; the text string as a 'text' string and &lt;SPAN class="hps"&gt;ignores&lt;/SPAN&gt; the 'mtext' formatting codes...&lt;/P&gt;
&lt;P&gt;Internal MText editor, also &lt;SPAN class="hps"&gt;ignores&lt;/SPAN&gt; the 'mtext' formatting codes, if we enter formatting codes the editor evalutes as text &lt;SPAN class="hps"&gt;characters, not formatting codes, if we define an external text editor, ie. notepad, the the formatting codes are evaluated as formatting codes in MText, but not in fields...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;Sorry, but I can´t find a way to format text inside a field... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;Henrique&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 08:58:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5862650#M137618</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-10-15T08:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5862773#M137619</link>
      <description>Thank you Henrique! I appreciate your assistance so far.&lt;BR /&gt;&lt;BR /&gt;I was thinking along the same lines at the end of the day yesterday. As I was doing some searching yesterday, I found a few ideas that have to do with converting the fields to text. It seems to me after that it would be possible to apply the mtext formatting...Would you have any ideas is this direction?</description>
      <pubDate>Thu, 15 Oct 2015 11:29:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5862773#M137619</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-15T11:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5863278#M137620</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;Thank you Henrique! I appreciate your assistance so far.&lt;BR /&gt;&lt;BR /&gt;I was thinking along the same lines at the end of the day yesterday. As I was doing some searching yesterday, I found a few ideas that have to do with converting the fields to text. It seems to me after that it would be possible to apply the mtext formatting...Would you have any ideas is this direction?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi Joe,&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extract-objects-containing-a-specific-field/m-p/5436450#M328157" target="_blank"&gt;this thread &lt;/A&gt;may be &lt;SPAN class="hps"&gt;useful...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 16:09:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5863278#M137620</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-10-15T16:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5863438#M137621</link>
      <description>Hi Henrique,&lt;BR /&gt;&lt;BR /&gt;Thank you for the link! I think I am seeing a connection between what I am trying to do and the code in the thread. I believe it will be useful, as soon as I can try something out. I'll let you what I come up with.&lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;BR /&gt;&lt;BR /&gt;Joe</description>
      <pubDate>Thu, 15 Oct 2015 17:36:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5863438#M137621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-15T17:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5863663#M137622</link>
      <description>Henrique,&lt;BR /&gt;&lt;BR /&gt;I tried the code from the link and it does work, but, it converts all the fields. I only need it to convert 1 field. I don't know if it makes a difference, the fields I have are all custom defined fields.&lt;BR /&gt;&lt;BR /&gt;Thank you again!&lt;BR /&gt;&lt;BR /&gt;Joe</description>
      <pubDate>Thu, 15 Oct 2015 19:29:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5863663#M137622</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-15T19:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5863752#M137623</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;Henrique,&lt;BR /&gt;&lt;BR /&gt;I tried the code from the link and it does work, but, it converts all the fields. I only need it to convert 1 field. I don't know if it makes a difference, the fields I have are all custom defined fields.&lt;BR /&gt;&lt;BR /&gt;Thank you again!&lt;BR /&gt;&lt;BR /&gt;Joe&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Joe,&lt;/P&gt;
&lt;P&gt;to convert only the field we need to convert, we have fo &lt;SPAN class="hps"&gt;provide to the 'ssfield' function, a test sting &lt;SPAN class="hps alt-edited"&gt;not present in other&lt;/SPAN&gt; fields, the more complete, &lt;SPAN class="hps alt-edited"&gt;better&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;If the field&amp;nbsp;you need to convert it's the only field using the dwg variable,&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;(ssfield "Lisp.dwg&amp;gt;%")&lt;/PRE&gt;
&lt;P&gt;should &lt;SPAN class="hps"&gt;do the trick...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 20:26:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5863752#M137623</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-10-15T20:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5864523#M137624</link>
      <description>&lt;P&gt;Henrique,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried it as you had it and several other ways and none of the fields were&amp;nbsp;converted.&amp;nbsp; Maybe it would help if you could see what the other fieldcodes actually are.&amp;nbsp; I am attaching a drawing to see if that might help so that you can see in context the other fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again, alot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 11:50:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5864523#M137624</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-16T11:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5865474#M137625</link>
      <description>&lt;P&gt;Joe,&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;the following quick and dirty&lt;/SPAN&gt;&amp;nbsp;&lt;EM&gt;'demo'&lt;/EM&gt; will &lt;SPAN class="hps"&gt;search&lt;/SPAN&gt; for an MText &lt;SPAN class="hps"&gt;entity&lt;/SPAN&gt;, with a field, &lt;SPAN class="hps alt-edited"&gt;having&lt;/SPAN&gt; "CustomDP.DwgNum" in the 'FIELDCODE', will remove the fields, &lt;SPAN class="hps"&gt;search&lt;/SPAN&gt; for "REV:", and format the Mtext string with color 6 &lt;SPAN class="hps"&gt;all characters&lt;/SPAN&gt; &lt;SPAN class="hps alt-edited"&gt;until&lt;/SPAN&gt; "REV:"...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:demo (/ ssfield hnd i obj pre pos suf ss str)
   ;; http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-field-to-text/td-p/1722015/page/2
   ;; by Ian_Bryant
   (defun del-field (ent / edic elist etype obj val)
      (if
         (and
            (setq edic (cdr (assoc 360 (setq elist (entget ent)))))
            (dictsearch edic "ACAD_FIELD")
         )
           (progn
              (setq obj   (vlax-ename-&amp;gt;vla-object ent)
                    etype (cdr (assoc 0 elist))
              )
              (cond
                 ((= etype "MTEXT")
                  (setq val (vla-get-textstring obj))
                  (dictremove edic "ACAD_FIELD")
                  (vla-put-textstring obj val)
                 )
                 (T (dictremove edic "ACAD_FIELD"))
              )
           )
      )
   )
   ;; by me
   (defun ssfield (str / hnd i obj ss ss1)
      (if (setq ss (ssget "_X" '((0 . "MTEXT"))))
         (progn
            (setq ss1 (ssadd))
            (repeat (setq i (sslength ss))
               (setq hnd (ssname ss (setq i (1- i)))
                     obj (vlax-ename-&amp;gt;vla-object hnd)
               )
               (if (and (vlax-method-applicable-p obj 'FIELDCODE)
                        (wcmatch (vlax-invoke-method obj 'FIELDCODE) (strcat "*" str "*"))
                   )
                  (ssadd hnd ss1)
               )
            )
            ss1
         )
      )
   )
   (if (setq ss (ssfield "CustomDP.DwgNum"))
      (repeat (setq i (sslength ss))
         (setq hnd (ssname ss (setq i (1- i)))
               obj (vlax-ename-&amp;gt;vla-object hnd)
         )
         (if (vlax-write-enabled-p obj)
            (progn
               (del-field hnd)
               (setq str (vla-get-textstring obj))
               (if (and (setq pos (vl-string-search "REV:" str))
                        (setq pre (substr str 1 pos))
                        (setq suf (substr str (1+ pos)))
                   )
                  (vla-put-textstring obj (strcat "{\\C6;" pre "}" suf))
               )
            )
         )
      )
   )
   (vla-regen (vla-get-activedocument (vlax-get-acad-object)) acallviewports)
   (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 19:47:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5865474#M137625</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-10-16T19:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5867929#M137626</link>
      <description>Henrique,&lt;BR /&gt;&lt;BR /&gt;This now works as expected!&lt;BR /&gt;&lt;BR /&gt;Thank you so much!&lt;BR /&gt;&lt;BR /&gt;Joe</description>
      <pubDate>Mon, 19 Oct 2015 15:21:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5867929#M137626</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-19T15:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Formatting In A Field</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5867933#M137627</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;Henrique,&lt;BR /&gt;&lt;BR /&gt;This now works as expected!&lt;BR /&gt;&lt;BR /&gt;Thank you so much!&lt;BR /&gt;&lt;BR /&gt;Joe&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're welcome, Joe&lt;BR /&gt;Glad I could help&lt;BR /&gt;&lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2015 15:22:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mtext-formatting-in-a-field/m-p/5867933#M137627</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-10-19T15:22:46Z</dc:date>
    </item>
  </channel>
</rss>

