<?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: How to change all the DOCUMENTS of the TileMode to 0. in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-change-all-the-documents-of-the-tilemode-to-0/m-p/3948182#M49568</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/659171"&gt;@classof&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;I have solved this problem.&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;I have added the&amp;nbsp;CommandFlags.Session.&lt;/P&gt;&lt;P&gt;thank you~&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If only someone had suggested that before... Regardless, glad you got it sorted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jun 2013 04:37:59 GMT</pubDate>
    <dc:creator>BlackBox_</dc:creator>
    <dc:date>2013-06-06T04:37:59Z</dc:date>
    <item>
      <title>How to change all the DOCUMENTS of the TileMode to 0.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-change-all-the-documents-of-the-tilemode-to-0/m-p/3925771#M49563</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;I would like to change all the DOCUMENTS of the TileMode to 0.&lt;BR /&gt;But, the following code the ActiveDocument changes only.&lt;BR /&gt;How can I modify the code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim acdc As DocumentCollection = Application.DocumentManager
        Dim acdoc As Document = acdc.MdiActiveDocument
        Dim acTile As Integer = Application.GetSystemVariable("TileMode")

        For Each acdoc In acdc

            If acTile = 1 Then
                Application.SetSystemVariable("TILEMODE", 0)
            End If

        Next

    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2013 03:35:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-change-all-the-documents-of-the-tilemode-to-0/m-p/3925771#M49563</guid>
      <dc:creator>classof</dc:creator>
      <dc:date>2013-05-17T03:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to change all the DOCUMENTS of the TileMode to 0.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-change-all-the-documents-of-the-tilemode-to-0/m-p/3927599#M49564</link>
      <description>&lt;P&gt;Take a look at the article&lt;/P&gt;&lt;PRE&gt;        'See article here:
        '&lt;A target="_blank" href="http://adndevblog.typepad.com/autocad/2012/05/when-to-lock-the-document.html?cid=6a0167607c2431970b0177443a993b970d"&gt;http://adndevblog.typepad.com/autocad/2012/05/when-to-lock-the-document.html?cid=6a0167607c2431970b0177443a993b970d&lt;/A&gt;
        &amp;lt;CommandMethod("stile")&amp;gt; _
        Public Sub switchTileMode()

            Try
                For Each doc As Document In Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager

                    If doc &amp;lt;&amp;gt; Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument Then

                        ' switch the active document 

                        Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument = doc

                        ' If you do not lock the document 

                        ' then the below code just simply has no effect 

                        ' whereas "doc.Database.TileMode = 

                        ' !doc.Database.TileMode;"  

                        ' would even crash AutoCAD       

                        ' If you lock the document then both should  work fine 

                        Using doc.LockDocument()

                            Dim tm As Short = CShort(Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("TILEMODE"))

                            Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("TILEMODE", (tm + 1) Mod 2)

                        End Using

                        Exit For

                    End If
                Next

            Catch ex As Autodesk.AutoCAD.Runtime.Exception
                Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(("Exception: " + ex.Message))
            Finally
                ' Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.CloseAll() 'to your needs

            End Try
        End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2013 11:39:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-change-all-the-documents-of-the-tilemode-to-0/m-p/3927599#M49564</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2013-05-18T11:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to change all the DOCUMENTS of the TileMode to 0.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-change-all-the-documents-of-the-tilemode-to-0/m-p/3947191#M49565</link>
      <description>&lt;P&gt;Hallex&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;So, I made the following code.. but,&amp;nbsp;Tilemod of all document does not change the value to 0.&lt;/P&gt;&lt;P&gt;Please help me..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.ApplicationServices

Public Class fsfaf

    &amp;lt;CommandMethod("ss")&amp;gt; _
    Public Sub ypf()

        Dim acdc As DocumentCollection = Application.DocumentManager

        For Each acdoc As Document In acdc

            If acdoc &amp;lt;&amp;gt; acdc.MdiActiveDocument Then
                acdc.MdiActiveDocument = acdoc
            End If

            Using acdoc.LockDocument()
                Dim acTile As Short = Application.GetSystemVariable("TileMode")
                If acTile = 1 Then
                    Application.SetSystemVariable("TILEMODE", 0)
                End If
            End Using
        Next
    End Sub
End Class&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2013 11:11:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-change-all-the-documents-of-the-tilemode-to-0/m-p/3947191#M49565</guid>
      <dc:creator>classof</dc:creator>
      <dc:date>2013-06-05T11:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to change all the DOCUMENTS of the TileMode to 0.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-change-all-the-documents-of-the-tilemode-to-0/m-p/3947444#M49566</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/523211"&gt;@Hallex&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Take a look at the article&lt;/P&gt;&lt;PRE&gt;        'See article here:
        '&lt;A href="http://adndevblog.typepad.com/autocad/2012/05/when-to-lock-the-document.html?cid=6a0167607c2431970b0177443a993b970d" target="_blank"&gt;http://adndevblog.typepad.com/autocad/2012/05/when-to-lock-the-document.html?cid=6a0167607c2431970b0177443a993b970d&lt;/A&gt;
        &amp;lt;CommandMethod("stile")&amp;gt; _
        Public Sub switchTileMode()
            '' &amp;lt;snip&amp;gt;
        End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Hallex,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Doesn't the article say that &lt;FONT color="#000080" face="georgia,palatino"&gt;&lt;EM&gt;CommandFlags.Session&lt;/EM&gt;&lt;/FONT&gt; is needed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;Example code snippet from the article you linked above:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// &amp;lt;snip&amp;gt;&lt;BR /&gt;[CommandMethod("MyTest", CommandFlags.Session)]
public void MyTestNet()
{
    // &amp;lt;snip&amp;gt;
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2013 14:26:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-change-all-the-documents-of-the-tilemode-to-0/m-p/3947444#M49566</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2013-06-05T14:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to change all the DOCUMENTS of the TileMode to 0.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-change-all-the-documents-of-the-tilemode-to-0/m-p/3948137#M49567</link>
      <description>&lt;P&gt;I have solved this problem.&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;I have added the&amp;nbsp;CommandFlags.Session.&lt;/P&gt;&lt;P&gt;thank you~&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2013 01:42:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-change-all-the-documents-of-the-tilemode-to-0/m-p/3948137#M49567</guid>
      <dc:creator>classof</dc:creator>
      <dc:date>2013-06-06T01:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to change all the DOCUMENTS of the TileMode to 0.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-change-all-the-documents-of-the-tilemode-to-0/m-p/3948182#M49568</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/659171"&gt;@classof&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;I have solved this problem.&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;I have added the&amp;nbsp;CommandFlags.Session.&lt;/P&gt;&lt;P&gt;thank you~&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If only someone had suggested that before... Regardless, glad you got it sorted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2013 04:37:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-change-all-the-documents-of-the-tilemode-to-0/m-p/3948182#M49568</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2013-06-06T04:37:59Z</dc:date>
    </item>
  </channel>
</rss>

