<?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: Draworder all layouts in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder-all-layouts/m-p/5951440#M135943</link>
    <description>&lt;P&gt;Hi guys, thanks for all help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/75977"&gt;@hmsilva&lt;/a&gt; wrote:&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;...&amp;nbsp;without the need to set each layout current.&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is priceless.&lt;/P&gt;&lt;P&gt;Thank you very much Henrique. This is perfect!&lt;/P&gt;&lt;P&gt;Marcelo&lt;/P&gt;</description>
    <pubDate>Tue, 15 Dec 2015 02:05:45 GMT</pubDate>
    <dc:creator>msarqui</dc:creator>
    <dc:date>2015-12-15T02:05:45Z</dc:date>
    <item>
      <title>Draworder all layouts</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder-all-layouts/m-p/5947873#M135939</link>
      <description>&lt;P&gt;Hi guys,&lt;BR /&gt;I need a "little" help here...&lt;BR /&gt;I would like to have all my MTEXT, in all layouts, bring to front with DRAWORDER.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I did this simple routine, but it works only in the current layout.&lt;/P&gt;&lt;PRE&gt;(defun c:btf (/ ss)
(if (setq ss (ssget "x"'((0 . "MTEXT"))))
	(command ".draworder" ss "" "front")
)
(princ)
)&lt;/PRE&gt;&lt;P&gt;How can it be made to work in all layouts?&lt;BR /&gt;For the final touch, could it be possible to filter only the MTEXT that has a background mask applied?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Marcelo&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 17:00:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder-all-layouts/m-p/5947873#M135939</guid>
      <dc:creator>msarqui</dc:creator>
      <dc:date>2015-12-11T17:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Draworder all layouts</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder-all-layouts/m-p/5947980#M135940</link>
      <description>&lt;P&gt;Since you're asking for a "little" help, I hope&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder/m-p/5903741#M336583" target="_self"&gt;this example&lt;/A&gt;&amp;nbsp;would help you enough.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 18:11:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder-all-layouts/m-p/5947980#M135940</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2015-12-11T18:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Draworder all layouts</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder-all-layouts/m-p/5947981#M135941</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/677724"&gt;@msarqui&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;....&lt;BR /&gt;I would like to have all my MTEXT, in all layouts, bring to front with DRAWORDER.&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;How can it be made to work in all layouts?&lt;BR /&gt;For the final touch, could it be possible to filter only the MTEXT that has a background mask applied?&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm not at my location where I can test about the Mtext background masking, but based on information in Help for 2016, I'll take a crack at it. &amp;nbsp;Try this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;(defun C:BTF (/ doit)&lt;BR /&gt;  (defun doit (/ ss)&lt;BR /&gt;    (if (setq ss (ssget "_X" (list '(0 . "MTEXT") (cons 410 (getvar 'ctab)) '(-4 . "&amp;gt;") '(90 . 0))))&lt;BR /&gt;      (command "_.draworder" ss "" "_front")&lt;BR /&gt;    ); if&lt;BR /&gt;  ); defun -- doit&lt;BR /&gt;  (foreach layout (layoutlist)&lt;BR /&gt;    (setvar 'ctab layout) (doit)&lt;BR /&gt;  ); foreach&lt;BR /&gt;  (setvar 'ctab "Model") (doit)&lt;BR /&gt;  (princ)&lt;BR /&gt;); defun -- BTF&lt;/PRE&gt;
&lt;P&gt;That's based on the DXF-90 entry in entity data being about background fill, including a given Mtext object&amp;nbsp;in the selection only if its value is greater than 0 [background fill&amp;nbsp;off]. &amp;nbsp;If I've misread the information, that may not be quite the right way to do it.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 18:10:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder-all-layouts/m-p/5947981#M135941</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-12-11T18:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Draworder all layouts</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder-all-layouts/m-p/5948639#M135942</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/677724"&gt;@msarqui&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi guys,&lt;BR /&gt;I need a "little" help here...&lt;BR /&gt;I would like to have all my MTEXT, in all layouts, bring to front with DRAWORDER.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I did this simple routine, but it works only in the current layout.&lt;/P&gt;
&lt;PRE&gt;(defun c:btf (/ ss)
(if (setq ss (ssget "x"'((0 . "MTEXT"))))
	(command ".draworder" ss "" "front")
)
(princ)
)&lt;/PRE&gt;
&lt;P&gt;How can it be made to work in all layouts?&lt;BR /&gt;For the final touch, could it be possible to filter only the MTEXT that has a background mask applied?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Marcelo&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi Marcelo,&lt;/P&gt;
&lt;P&gt;at the same thread Beekee's link, at &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder/m-p/5904410#M336600" target="_blank"&gt;post #9&lt;/A&gt;&amp;nbsp;I did post a code to change the draworder in all layouts &lt;SPAN class="hps"&gt;without the need to set each layout current.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;I did made some &lt;SPAN class="hps alt-edited"&gt;quick&lt;/SPAN&gt; changes to change the order of all MText objects with background mask on, to the top, without the need to set each layout current.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)
;; by me 12-12-2015
;; from BatchDrawOrder by Lee Ambrosius
;; http://www.cadtutor.net/corner/2008/january.php
(defun mtextorder (top / adoc blks extdic i lst n sortent tmplst)
    (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
    (vlax-for layt (vla-get-layouts adoc)
        (if (not (= (vla-get-name layt) "Model"))
            (progn
                (setq blks (vla-get-block layt))
                (if (vl-catch-all-error-p
                        (setq sortent (vl-catch-all-apply
                                          'vla-item
                                          (list (setq extdic (vla-getextensiondictionary blks)) "ACAD_SORTENTS")
                                      )
                        )
                    )
                    (setq sortent (vla-addobject extdic "ACAD_SORTENTS" "AcDbSortentsTable"))
                )
                (setq n   0
                      lst
                          nil
                )
                (vlax-for blk blks
                    (if (and (= (vla-get-objectname blk) "AcDbMText")
                             (= (vla-get-backgroundfill blk) :vlax-true)
                             )
                        (progn
                            (if (&amp;gt;= n 1)
                                (progn
                                    (setq tmplst lst)
                                    (setq lst (vlax-make-safearray vlax-vbObject (cons 0 n)))
                                    (setq i 0)
                                    (repeat n
                                        (vlax-safearray-put-element lst i (vlax-safearray-get-element tmplst i))
                                        (setq i (1+ i))
                                    )
                                )
                                (setq lst (vlax-make-safearray vlax-vbObject '(0 . 0)))
                            )
                            (vlax-safearray-put-element lst n blk)
                            (setq n (1+ n))
                        )
                    )
                )
                (if (/= lst nil)
                    (if (null top)
                        (vla-moveToBottom sortent lst)
                        (vla-moveToTop sortent lst)
                    )
                )
            )
        )
    )
)

(defun c:mt2top ()
    (mtextorder T)
    (princ)
)

(princ  "\n Enter 'MT2TOP' to move all MText with background mask to top... ")&lt;/PRE&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>Sat, 12 Dec 2015 11:29:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder-all-layouts/m-p/5948639#M135942</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-12-12T11:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Draworder all layouts</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder-all-layouts/m-p/5951440#M135943</link>
      <description>&lt;P&gt;Hi guys, thanks for all help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/75977"&gt;@hmsilva&lt;/a&gt; wrote:&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;...&amp;nbsp;without the need to set each layout current.&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is priceless.&lt;/P&gt;&lt;P&gt;Thank you very much Henrique. This is perfect!&lt;/P&gt;&lt;P&gt;Marcelo&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 02:05:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder-all-layouts/m-p/5951440#M135943</guid>
      <dc:creator>msarqui</dc:creator>
      <dc:date>2015-12-15T02:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Draworder all layouts</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder-all-layouts/m-p/5951709#M135944</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/677724"&gt;@msarqui&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi guys, thanks for all help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/75977"&gt;@hmsilva&lt;/a&gt; wrote:&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;...&amp;nbsp;without the need to set each layout current.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is priceless.&lt;/P&gt;
&lt;P&gt;Thank you very much Henrique. This is perfect!&lt;/P&gt;
&lt;P&gt;Marcelo&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're welcome, Marcelo!&lt;BR /&gt;Glad I could help&lt;BR /&gt;&lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 09:14:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draworder-all-layouts/m-p/5951709#M135944</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-12-15T09:14:39Z</dc:date>
    </item>
  </channel>
</rss>

