<?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: [iLogic] Deleting Custom Table &amp;amp; Entering Values in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/3220752#M138475</link>
    <description>&lt;P&gt;No Problem, this snippet of code may also be worth keeping in storage. It will delete a table from your drawing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

' Set a reference to the active sheet.
Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet

If (oSheet.CustomTables.Count &amp;gt; 0) Then
  	oSheet.CustomTables.item(1).Delete
End If&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if you have more than 1 table in the drawing, you will have to run the code twice! Im still trying to change the code so it will delete ALL tables in one instance. I'll let you know if i find a solution &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2011 15:40:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-11-08T15:40:51Z</dc:date>
    <item>
      <title>[iLogic] Deleting Custom Table &amp; Entering Values</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/3214076#M138471</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to insert a table on one of my Inventor drawings, however, it will vary in size (Fixed colums, variable number of rows). I have searched the forum and found this snippet of code to add a 2x20 table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub Main()
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet

' Set the column titles
Dim oTitles() As String = {"Member","Pos. From Datum A"}

Dim oPoint As Point2d
oPoint = ThisApplication.TransientGeometry.CreatePoint2d(1, 28.7)

' Create the custom table
Dim oCustomTable As CustomTable

oCustomTable = oSheet.CustomTables.Add("Infill Spacing", oPoint, 2, 20, oTitles)
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;The Problem&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I now need to be able to do two things:&lt;/P&gt;&lt;P&gt;1. Delete all custom tables that may be on the drawing ( I may have more than 1 custom table on the drawing)&lt;/P&gt;&lt;P&gt;2. Access the individual rows and colums in a specific table so I can write a variable into them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched high and low for the API commands, but cant seem to find them. As always, any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2011 15:42:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/3214076#M138471</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-02T15:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: [iLogic] Deleting Custom Table &amp; Entering Values</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/3220298#M138472</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After some extensive searching, I have found a bit of code hidden away in the help section of Inventor to create a custom table and then edit the values in the table. I had to modify it slightly to remove some error messages, I think it was written for an older version of VB.NET? (I have attached the code should it be of use to anyone)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the number of rows will change depending on the model (which i will edit the code to do). But I still need to be able to delete it, and re-run the code to add the new table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a command which will delete ALL custom tables on the sheet? (not the parts list). I am using Inventor 2012.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2011 11:27:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/3220298#M138472</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-08T11:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: [iLogic] Deleting Custom Table &amp; Entering Values</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/3220684#M138473</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for posting this code, i do not have a use for it at this moment in time, however it may be useful in the future.&lt;/P&gt;&lt;P&gt;I cut and pasted the code into a rule within a idw , ran the rule and nothing appeared to happen, is there a step i missed?&lt;/P&gt;&lt;P&gt;I am using Inventor/Ilogic 2009&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2011 15:16:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/3220684#M138473</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-08T15:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: [iLogic] Deleting Custom Table &amp; Entering Values</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/3220718#M138474</link>
      <description>&lt;P&gt;Forget my last post, it created the table, but off the "paper" i just didnt see it&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2011 15:29:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/3220718#M138474</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-08T15:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: [iLogic] Deleting Custom Table &amp; Entering Values</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/3220752#M138475</link>
      <description>&lt;P&gt;No Problem, this snippet of code may also be worth keeping in storage. It will delete a table from your drawing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

' Set a reference to the active sheet.
Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet

If (oSheet.CustomTables.Count &amp;gt; 0) Then
  	oSheet.CustomTables.item(1).Delete
End If&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if you have more than 1 table in the drawing, you will have to run the code twice! Im still trying to change the code so it will delete ALL tables in one instance. I'll let you know if i find a solution &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2011 15:40:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/3220752#M138475</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-08T15:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: [iLogic] Deleting Custom Table &amp; Entering Values</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/3220892#M138476</link>
      <description>&lt;P&gt;Hi, thanks for the code!&lt;/P&gt;&lt;P&gt;I made a small adjustment to it to delete all tables on the drawing sheet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;' Set a reference to the drawing document.&lt;/P&gt;&lt;P&gt;' This assumes a drawing document is active.&lt;/P&gt;&lt;P&gt;Dim&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;oDrawDoc &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#ff0000" size="3"&gt;&lt;FONT color="#ff0000" size="3"&gt;As &lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;DrawingDocument&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;oDrawDoc&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" size="3"&gt;&lt;FONT color="#800080" size="3"&gt;ThisApplication&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;.ActiveDocument&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;' Set a reference to the active sheet.&lt;/P&gt;&lt;P&gt;Dim&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;oSheet &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#ff0000" size="3"&gt;&lt;FONT color="#ff0000" size="3"&gt;As &lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;Sheet&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;oSheet&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;= &lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;oDrawDoc.ActiveSheet&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Dim&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;numtables &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;STRONG&gt;&lt;FONT color="#ff0000" size="3"&gt;&lt;FONT color="#ff0000" size="3"&gt;As Integer&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Dim&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;i &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#ff0000" size="3"&gt;&lt;FONT color="#ff0000" size="3"&gt;As Integer&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;numtables&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;= &lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;oSheet.CustomTables.Count&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;For&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;i &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;= 1 &lt;/FONT&gt;&lt;FONT color="#ff0000" size="3"&gt;&lt;FONT color="#ff0000" size="3"&gt;To &lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;numtables&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;oSheet.CustomTables.item&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;(1)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#800000" size="3"&gt;&lt;FONT color="#800000" size="3"&gt;.Delete&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2011 16:51:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/3220892#M138476</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-08T16:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: [iLogic] Deleting Custom Table &amp; Entering Values</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/5506655#M138477</link>
      <description>&lt;P&gt;I realize this is an old post and I'm rather new to programming but I hope someone can give me an answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why not simplify the code to what I have below? It seems pointless to have to declare variables that don't need declaring... I'm guessing it's a difference between Inventor coding and straight up VB coding...&lt;/P&gt;&lt;P&gt;&amp;n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AN&gt;item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Delete&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Feb 2015 16:45:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-deleting-custom-table-amp-entering-values/m-p/5506655#M138477</guid>
      <dc:creator>S7RM7RPR</dc:creator>
      <dc:date>2015-02-13T16:45:03Z</dc:date>
    </item>
  </channel>
</rss>

