<?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: Creating a table in a drawing using ilogic in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-table-in-a-drawing-using-ilogic/m-p/9811346#M57158</link>
    <description>&lt;P&gt;Also, near the top of your code, where your searching for a Custom Table, then deleting it.&amp;nbsp; The If line doesn't appear to be written correctly.&amp;nbsp; The InStr() function needs two input variables, and it looks like you only supplied it one variable.&amp;nbsp; That function searches for one sub string within another string, and returns the position (represented by an Integer) of that found sub string within the original.&amp;nbsp; Some use this to see if one string is contained within another.&amp;nbsp; There is perhaps a less confusing way to do this, that is a little easier to read.&amp;nbsp; You can use the Contains() function instead.&lt;/P&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;For Each oCustomTable As Inventor.CustomTable In oSheet.CustomTables
    If oCustomTable.Title.Contains("sample") Then ' &amp;lt;&amp;lt;&amp;lt; CHANGE THIS SEARCH TERM
        oCustomTable.Delete
    End If
Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;If you have time, please... Vote For &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank"&gt;My IDEAS &lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt;&lt;/SPAN&gt;&lt;/A&gt;and Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.autodesk.com/view/INVNTOR/2020/ENU/" target="_blank"&gt;Inventor 2020 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Oct 2020 18:11:44 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2020-10-19T18:11:44Z</dc:date>
    <item>
      <title>Creating a table in a drawing using ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-table-in-a-drawing-using-ilogic/m-p/9809996#M57156</link>
      <description>&lt;P&gt;Good day,&lt;/P&gt;
&lt;P&gt;I'm completely confused when creating a table in a drawing using ilogic.&lt;/P&gt;
&lt;P&gt;Here's what I wanted to do:&lt;/P&gt;
&lt;P&gt;1. When you run the rules to select the view in the drawing.;&lt;BR /&gt;2. If axonometry is selected, then continue if not, then error;&lt;BR /&gt;3. Deletes the table if it was created earlier for the selected view to this view;&lt;BR /&gt;4. Create a table with the number of rows taken from the parameters of the selected type;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;' add custom table.&lt;/SPAN&gt;
&lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;

&lt;SPAN&gt;' Set a reference to the active sheet. &lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Sheet&lt;/SPAN&gt; 
&lt;SPAN&gt;oSheet&lt;/SPAN&gt; = &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveSheet&lt;/SPAN&gt; 

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oCustomTable&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;CustomTables&lt;/SPAN&gt;
    &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;InStr&lt;/SPAN&gt;(&lt;SPAN&gt;oCustomTable&lt;/SPAN&gt;.&lt;SPAN&gt;Title&lt;/SPAN&gt;) &amp;gt; 0 &lt;SPAN&gt;Then&lt;/SPAN&gt;
        &lt;SPAN&gt;oCustomTable&lt;/SPAN&gt;.&lt;SPAN&gt;Delete&lt;/SPAN&gt;
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;

&lt;SPAN&gt;' Set the column titles &lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oTitles&lt;/SPAN&gt;(2) &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; 
&lt;SPAN&gt;oTitles&lt;/SPAN&gt;(0) = &lt;SPAN&gt;"№ сгиба"&lt;/SPAN&gt; 
&lt;SPAN&gt;oTitles&lt;/SPAN&gt;(1) = &lt;SPAN&gt;"Расстояние до начала гиба от базы A1 ,мм"&lt;/SPAN&gt; 
&lt;SPAN&gt;oTitles&lt;/SPAN&gt;(2) = &lt;SPAN&gt;"Угол в плоскости гиба"&lt;/SPAN&gt; 


&lt;SPAN&gt;' Set the contents of the custom table (contents are set row-wise) &lt;/SPAN&gt;
&lt;SPAN&gt;х&lt;/SPAN&gt; = &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;"Труба ilogic (Новая).ipt.Кол_гибов"&lt;/SPAN&gt;)

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oContents&lt;/SPAN&gt;(&lt;SPAN&gt;х&lt;/SPAN&gt;*3) &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; 
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;i1&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt;  = 0

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;i&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt; = 1 &lt;SPAN&gt;To&lt;/SPAN&gt; &lt;SPAN&gt;x&lt;/SPAN&gt;
	
&lt;SPAN&gt;oContents&lt;/SPAN&gt;(&lt;SPAN&gt;i1&lt;/SPAN&gt;) = &lt;SPAN&gt;"Parameter"&lt;/SPAN&gt;&amp;amp;&lt;SPAN&gt;i&lt;/SPAN&gt;
&lt;SPAN&gt;i1&lt;/SPAN&gt;+=1

&lt;SPAN&gt;Next&lt;/SPAN&gt;

&lt;SPAN&gt;' Set the column widths (defaults to the column title width if not specified) &lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oColumnWidths&lt;/SPAN&gt;(2) &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; 
&lt;SPAN&gt;oColumnWidths&lt;/SPAN&gt;(0) = 4
&lt;SPAN&gt;oColumnWidths&lt;/SPAN&gt;(1) = 4 
&lt;SPAN&gt;oColumnWidths&lt;/SPAN&gt;(2) = 4


&lt;SPAN&gt;' Create the custom table &lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCustomTable&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;CustomTable&lt;/SPAN&gt; 
&lt;SPAN&gt;oCustomTable&lt;/SPAN&gt; = &lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;CustomTables&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;"Таблица гибов"&lt;/SPAN&gt;, &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN&gt;CreatePoint2d&lt;/SPAN&gt;(0, 0), 4, 4, &lt;SPAN&gt;oTitles&lt;/SPAN&gt;, &lt;SPAN&gt;oContents&lt;/SPAN&gt;, &lt;SPAN&gt;oColumnWidths&lt;/SPAN&gt;) &lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Oct 2020 06:06:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-table-in-a-drawing-using-ilogic/m-p/9809996#M57156</guid>
      <dc:creator>Rogov_Sergey</dc:creator>
      <dc:date>2020-10-19T06:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table in a drawing using ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-table-in-a-drawing-using-ilogic/m-p/9811327#M57157</link>
      <description>&lt;P&gt;I think I may see the problem with your code.&amp;nbsp; It looks like you are trying to create a custom table that is 4 columns wide and 4 rows tall.&amp;nbsp; But you are only specifying 3 titles, and 3 column widths.&amp;nbsp; And, I'm not quite sure, but it doesn't look like your oContents array is the right size either.&lt;/P&gt;&lt;P&gt;When specifying the titles, you need to supply one title for each column you are creating, or it will throw an error.&lt;/P&gt;&lt;P&gt;Same with column widths, one for each column (no more, no less).&lt;/P&gt;&lt;P&gt;And when specifying the contents of the table, there needs to be a value supplied for each cell within the table, even if the value is a null (empty) string.&amp;nbsp; So for a 4 x 4 table, you would have to supply 16 values.&lt;/P&gt;&lt;P&gt;Each value of the supplied contents array will fill the next cell in the row.&amp;nbsp; Once the row is full, it will start populating the next row of the table, and so on.&amp;nbsp;&amp;nbsp; Left to right across the top row, then left to right across the next row down, until it reaches the last cell in the table.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/?guid=GUID-21C6C7AC-DE56-4746-ABE8-79D0D6A68C26" target="_blank" rel="noopener"&gt;Here is a link&lt;/A&gt; to the online help page for that function.&amp;nbsp; That page also contains a link to another page that has an example VBA code, which builds a 3 x 3 table.&lt;/P&gt;&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;If you have time, please... Vote For &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank"&gt;My IDEAS &lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt;&lt;/SPAN&gt;&lt;/A&gt;and Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.autodesk.com/view/INVNTOR/2020/ENU/" target="_blank"&gt;Inventor 2020 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 18:11:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-table-in-a-drawing-using-ilogic/m-p/9811327#M57157</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-10-19T18:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table in a drawing using ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-table-in-a-drawing-using-ilogic/m-p/9811346#M57158</link>
      <description>&lt;P&gt;Also, near the top of your code, where your searching for a Custom Table, then deleting it.&amp;nbsp; The If line doesn't appear to be written correctly.&amp;nbsp; The InStr() function needs two input variables, and it looks like you only supplied it one variable.&amp;nbsp; That function searches for one sub string within another string, and returns the position (represented by an Integer) of that found sub string within the original.&amp;nbsp; Some use this to see if one string is contained within another.&amp;nbsp; There is perhaps a less confusing way to do this, that is a little easier to read.&amp;nbsp; You can use the Contains() function instead.&lt;/P&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;For Each oCustomTable As Inventor.CustomTable In oSheet.CustomTables
    If oCustomTable.Title.Contains("sample") Then ' &amp;lt;&amp;lt;&amp;lt; CHANGE THIS SEARCH TERM
        oCustomTable.Delete
    End If
Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;If you have time, please... Vote For &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank"&gt;My IDEAS &lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt;&lt;/SPAN&gt;&lt;/A&gt;and Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.autodesk.com/view/INVNTOR/2020/ENU/" target="_blank"&gt;Inventor 2020 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 18:11:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-table-in-a-drawing-using-ilogic/m-p/9811346#M57158</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-10-19T18:11:44Z</dc:date>
    </item>
  </channel>
</rss>

