<?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: Coordinates Table to Text File C# in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246919#M16741</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/581173"&gt;@fsztuczny&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The codes are working properly. saved the txt file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I print only "Num. of .vert" "X", "Y" values without a table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so the table is exploded&lt;/P&gt;</description>
    <pubDate>Sat, 17 Apr 2021 15:53:31 GMT</pubDate>
    <dc:creator>k005</dc:creator>
    <dc:date>2021-04-17T15:53:31Z</dc:date>
    <item>
      <title>Coordinates Table to Text File C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246787#M16739</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;How can I save the coordinate list to a text file?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 14:22:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246787#M16739</guid>
      <dc:creator>k005</dc:creator>
      <dc:date>2021-04-17T14:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinates Table to Text File C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246885#M16740</link>
      <description>&lt;P&gt;Add reference to the System.Windows.Forms&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Zrzut ekranu 2021-04-17 172054.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/908091i06E84DDCDA375809/image-size/large?v=v2&amp;amp;px=999" role="button" title="Zrzut ekranu 2021-04-17 172054.png" alt="Zrzut ekranu 2021-04-17 172054.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    [CommandMethod( "tableToTextFile", CommandFlags.Modal )]
    public void tableToTextFile() // This method can have any name
    {
      // Put your command code here
      Document doc = Application.DocumentManager.MdiActiveDocument;
      Editor ed = doc.Editor;
      Database db = doc.Database;
      try
      {
        PromptEntityOptions peo = new PromptEntityOptions( "\nPick a table: " );
        peo.SetRejectMessage( "\nThis is not a table!" );
        peo.AddAllowedClass( typeof( Table ), true );
        PromptEntityResult per = ed.GetEntity( peo );
        if( per.Status != PromptStatus.OK )
        {
          return;
        }
        ObjectId tableId = per.ObjectId;

        string filePath = null;
        using( System.Windows.Forms.SaveFileDialog saveDialog = new System.Windows.Forms.SaveFileDialog() )
        {
          saveDialog.Title = "Save the text file as...";
          saveDialog.DefaultExt = "*.txt";
          saveDialog.Filter = "Text files|" + saveDialog.DefaultExt;
          saveDialog.AddExtension = true;
          saveDialog.CheckFileExists = false;
          saveDialog.CheckPathExists = true;
          saveDialog.OverwritePrompt = true;
          saveDialog.FilterIndex = 0;
          saveDialog.InitialDirectory = Environment.GetFolderPath( Environment.SpecialFolder.MyDocuments );
          System.Windows.Forms.DialogResult dr = saveDialog.ShowDialog();

          if( dr != System.Windows.Forms.DialogResult.OK )
          {
            return;
          } //
          filePath = saveDialog.FileName;
        } //using( System.Windows.Forms.SaveFileDialog openDialog = new System.Windows.Forms.SaveFileDialog() )

        using( System.IO.StreamWriter sw = new System.IO.StreamWriter( filePath ) )
        {
          const string fileColumnSeparator = "\t" /*tabulator*/;
          using( Transaction tr = db.TransactionManager.StartOpenCloseTransaction() )
          {
            Table tab = tr.GetObject( tableId, OpenMode.ForRead ) as Table;
            for( int r = 0; r &amp;lt; tab.Rows.Count; r++ )
            {
              System.Text.StringBuilder sb = new System.Text.StringBuilder();
              for( int c = 0; c &amp;lt; tab.Columns.Count; c++ )
              {
                sb.Append( tab.Cells[r, c].TextString );
                if( c &amp;lt; tab.Columns.Count - 1 )
                {
                  sb.Append( fileColumnSeparator );
                }
              }
              sw.WriteLine( sb.ToString() );
            }
          }
        }
      }
      catch( System.Exception e )
      {
        ed.WriteMessage( e.ToString() );
      }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also using built-in command: "_TABLEEXPORT"&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 15:28:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246885#M16740</guid>
      <dc:creator>fsztuczny</dc:creator>
      <dc:date>2021-04-17T15:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinates Table to Text File C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246919#M16741</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/581173"&gt;@fsztuczny&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The codes are working properly. saved the txt file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I print only "Num. of .vert" "X", "Y" values without a table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so the table is exploded&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 15:53:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246919#M16741</guid>
      <dc:creator>k005</dc:creator>
      <dc:date>2021-04-17T15:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinates Table to Text File C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246934#M16742</link>
      <description>&lt;P&gt;Sure. You can change the loop:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;            for( int r = 1; r &amp;lt; tab.Rows.Count; r++ )
            {
              System.Text.StringBuilder sb = new System.Text.StringBuilder();
              for( int c = 0; c &amp;lt; tab.Columns.Count; c++ )
              {
                sb.Append( tab.Cells[r, c].TextString );
                if( c &amp;lt; tab.Columns.Count - 1 )
                {
                  sb.Append( fileColumnSeparator );
                }
              }
              sw.WriteLine( sb.ToString() );
            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 15:56:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246934#M16742</guid>
      <dc:creator>fsztuczny</dc:creator>
      <dc:date>2021-04-17T15:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinates Table to Text File C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246947#M16743</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/581173"&gt;@fsztuczny&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In that :&lt;/P&gt;&lt;P&gt;in some cases there is a table.&lt;BR /&gt;in some cases there is also DBTEXT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 16:10:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246947#M16743</guid>
      <dc:creator>k005</dc:creator>
      <dc:date>2021-04-17T16:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinates Table to Text File C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246967#M16744</link>
      <description>&lt;P&gt;Unfortunately, this is related to the multi-level sorting of the text insertion coordinates and taking into account the text dimensions. This is not to be done in a moment. May introduce potential errors in the order of the texts. Stay with the table.&lt;/P&gt;&lt;P&gt;Maybe someone else will find a simple solution.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 16:20:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246967#M16744</guid>
      <dc:creator>fsztuczny</dc:creator>
      <dc:date>2021-04-17T16:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinates Table to Text File C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246973#M16745</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/581173"&gt;@fsztuczny&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much. For your help&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 16:24:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/coordinates-table-to-text-file-c/m-p/10246973#M16745</guid>
      <dc:creator>k005</dc:creator>
      <dc:date>2021-04-17T16:24:44Z</dc:date>
    </item>
  </channel>
</rss>

