<?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: Help centering MTEXT in a command macro in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10436189#M58673</link>
    <description>&lt;P&gt;No worries .. try these three options. The nice thing about entmake is the layer does not have to exist and in 2022 it works as intended.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":clinking_beer_mugs:"&gt;🍻&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(defun c:foo (/ p)
  (if (setq p (getpoint "\nPick a point to place mtext: "))
    (entmake (list '(0 . "MTEXT")
		   '(100 . "AcDbEntity")
		   '(8 . "LEADERS_&amp;amp;_ANNOTATION")
		   '(100 . "AcDbMText")
		   (cons 10 p)
		   '(46 . 0.)
		   '(71 . 5)
		   '(62 . 1)
		   '(1 . "GARAGE SLAB\P F.F.L 99.44")
		   '(7 . "Romans")
		   (cons 11 p)
		   '(50 . 0.)
	     )
    )
  )
  (princ)
)

(command "_.mtext"
	 (setq pt1 (getpoint "\nSelect Point: "))
	 "_J"
	 "_MC"
	 (getcorner pt1 "\nSelect Other point:")
	 "GARAGE SLAB\\P F.F.L 99.44"
	 ""
	 "_.chprop"
	 "_last"
	 ""
	 "_color"
	 1
	 "_LA"
	 "LEADERS_&amp;amp;_ANNOTATION"
	 ""
)
;; Hybrid
(defun c:foo2 (/ pt1)
  (command "_.mtext"
	   (setq pt1 (getpoint "\nSelect Point: "))
	   "_J"
	   "_MC"
	   (getcorner pt1 "\nSelect Other point:")
	   "GARAGE SLAB\\P F.F.L 99.44"
	   ""
  )
  (entmod (append (entget (entlast)) '((62 . 1) (8 . "LEADERS_&amp;amp;_ANNOTATION"))))
  (princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jul 2021 15:52:31 GMT</pubDate>
    <dc:creator>ronjonp</dc:creator>
    <dc:date>2021-07-01T15:52:31Z</dc:date>
    <item>
      <title>Help centering MTEXT in a command macro</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10435949#M58668</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I really felt on the vurge of finally nutting one out for myself but this "_J" and "_MC" options are killing me.&amp;nbsp; I am wanting to create a bunch of prefilled text notes, could add them to a tool palette and drag and drop as I see fit.&amp;nbsp; The kind of notes you use all the time in standard jobs.&amp;nbsp; So I'm basically here at this point:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(command&lt;BR /&gt;"mtext" (setq pt1 (getpoint "\nSelect Point: ")) (getcorner pt1 "\nSelect Other point:") "GARAGE SLAB\\P F.F.L 99.44" ""&lt;BR /&gt;"_.chprop" "_last" "" "_color" 1 "_LA" "LEADERS_&amp;amp;_ANNOTATION" "")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which does indeed work and drops the prefilled text in, changes it to the right layer and color etc.&amp;nbsp; Only thing is that its LEFT justifying the text.&amp;nbsp; I need it MIDDLE CENTERED...hence the battling with the 'J' and 'MC' variables.&amp;nbsp; I've tried putting them in a bunch of places, with and without brackets, quotes etc... every time I do though, my working version falls over and doesn't work anymore.&amp;nbsp; I'll kick myself when someone shows me but at nearly 1:00am, I'm happy to wear the shame.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks everyone.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 14:46:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10435949#M58668</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-01T14:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help centering MTEXT in a command macro</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10436097#M58669</link>
      <description>&lt;P&gt;You might take a look at &lt;A href="http://www.theswamp.org/index.php?topic=1392.0" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;this&lt;/STRONG&gt;&lt;/A&gt; as well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 15:20:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10436097#M58669</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2021-07-01T15:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help centering MTEXT in a command macro</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10436121#M58670</link>
      <description>&lt;P&gt;Not sure how signing up &amp;amp; becoming a member of another site for helps me..?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 15:26:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10436121#M58670</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-01T15:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help centering MTEXT in a command macro</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10436145#M58671</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Not sure how signing up &amp;amp; becoming a member of another site for helps me..?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Many great solutions on that forum .. that is how it 'might' help you.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ronjonp_0-1625153439338.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/936666i2749487787CABE7B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ronjonp_0-1625153439338.png" alt="ronjonp_0-1625153439338.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 15:35:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10436145#M58671</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2021-07-01T15:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help centering MTEXT in a command macro</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10436167#M58672</link>
      <description>&lt;P&gt;Yeah I should have said sorry; I am aware of that TextInsert LISP routine. Doing it with a macro command just seemed less cumbersome &amp;amp; fewer mouse clicks to get the desired text in. Once they were all set up anyway.&lt;/P&gt;&lt;P&gt;I also felt so close to nailing it with what I'd written above..didn't want to let it beat me!&lt;/P&gt;&lt;P&gt;Will check out the suggested site for future reference though, thankyou.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 15:41:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10436167#M58672</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-01T15:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help centering MTEXT in a command macro</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10436189#M58673</link>
      <description>&lt;P&gt;No worries .. try these three options. The nice thing about entmake is the layer does not have to exist and in 2022 it works as intended.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":clinking_beer_mugs:"&gt;🍻&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(defun c:foo (/ p)
  (if (setq p (getpoint "\nPick a point to place mtext: "))
    (entmake (list '(0 . "MTEXT")
		   '(100 . "AcDbEntity")
		   '(8 . "LEADERS_&amp;amp;_ANNOTATION")
		   '(100 . "AcDbMText")
		   (cons 10 p)
		   '(46 . 0.)
		   '(71 . 5)
		   '(62 . 1)
		   '(1 . "GARAGE SLAB\P F.F.L 99.44")
		   '(7 . "Romans")
		   (cons 11 p)
		   '(50 . 0.)
	     )
    )
  )
  (princ)
)

(command "_.mtext"
	 (setq pt1 (getpoint "\nSelect Point: "))
	 "_J"
	 "_MC"
	 (getcorner pt1 "\nSelect Other point:")
	 "GARAGE SLAB\\P F.F.L 99.44"
	 ""
	 "_.chprop"
	 "_last"
	 ""
	 "_color"
	 1
	 "_LA"
	 "LEADERS_&amp;amp;_ANNOTATION"
	 ""
)
;; Hybrid
(defun c:foo2 (/ pt1)
  (command "_.mtext"
	   (setq pt1 (getpoint "\nSelect Point: "))
	   "_J"
	   "_MC"
	   (getcorner pt1 "\nSelect Other point:")
	   "GARAGE SLAB\\P F.F.L 99.44"
	   ""
  )
  (entmod (append (entget (entlast)) '((62 . 1) (8 . "LEADERS_&amp;amp;_ANNOTATION"))))
  (princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 15:52:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10436189#M58673</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2021-07-01T15:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help centering MTEXT in a command macro</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10436453#M58674</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;....&amp;nbsp; I am wanting to create a bunch of prefilled text notes, could add them to a tool palette and drag and drop as I see fit.&amp;nbsp; ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;(command&lt;BR /&gt;"mtext" (setq pt1 (getpoint "\nSelect Point: ")) (getcorner pt1 "\nSelect Other point:") "GARAGE SLAB\\P F.F.L 99.44" ""&lt;BR /&gt;"_.chprop" "_last" "" "_color" 1 "_LA" "LEADERS_&amp;amp;_ANNOTATION" "")&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;....&amp;nbsp; I need it MIDDLE CENTERED...hence the battling with the 'J' and 'MC' variables.&amp;nbsp; ....&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This works for me in a macro in a Tool Palette button:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;^C^C_.-mtext \_j _mc \GARAGE SLAB;F.F.L 99.44;;_.chprop _l ;_c 1 _la LEADERS_&amp;amp;_ANNOTATION ;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 17:31:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10436453#M58674</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-07-01T17:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help centering MTEXT in a command macro</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10437513#M58675</link>
      <description>&lt;P&gt;Like Ronjonp look at mtext entmake and the codes 71 72 &amp;amp; 73 these can set orientation, I had to do a start end text so needed a left and right mtext.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 04:18:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10437513#M58675</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-07-02T04:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help centering MTEXT in a command macro</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10438285#M58676</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;.... look at mtext entmake and the codes 71 72 &amp;amp; 73 these can set orientation....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're confusing things by mixing up codes for Text vs. Mtext.&amp;nbsp; For &lt;STRONG&gt;Mtext&lt;/STRONG&gt;, 71 is the justification, but 72 is for &lt;EM&gt;drawing direction&lt;/EM&gt;, and 73 is for &lt;EM&gt;line spacing&lt;/EM&gt;.&amp;nbsp; For plain &lt;STRONG&gt;Text&lt;/STRONG&gt;, 71 is about whether it's&amp;nbsp;&lt;EM&gt;backwards and/or upside-down&lt;/EM&gt;, and it's the combination of the values of 72 &amp;amp; 73 that stores the justification.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 10:54:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10438285#M58676</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-07-02T10:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help centering MTEXT in a command macro</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10441901#M58677</link>
      <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I accepted Kents reply but props and much gratitude to you all as each of your suggestions and solutions worked.&amp;nbsp; Was just a question of which would was easiest to deploy.&amp;nbsp; I really do thank everyone that helped me here. Have a great night guys.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 08:39:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-centering-mtext-in-a-command-macro/m-p/10441901#M58677</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-04T08:39:09Z</dc:date>
    </item>
  </channel>
</rss>

