<?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 Drawing Table in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-table/m-p/10149550#M122046</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to tables, but I'm assuming this takes an ilogic rule to make.&amp;nbsp; I need a table to appear on the top left of each drawing.&amp;nbsp; The table just on column and&amp;nbsp; the amount of rows it has depends on the number of objects written in an iproperty field.&amp;nbsp; &amp;nbsp;If the parts custom iproperty 'Routing Steps' = "`" then no table. Something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;oModelDoc&lt;/SPAN&gt; = &lt;SPAN&gt;IO&lt;/SPAN&gt;.&lt;SPAN&gt;Path&lt;/SPAN&gt;.&lt;SPAN&gt;GetFileName&lt;/SPAN&gt;(&lt;SPAN&gt;ThisDrawing&lt;/SPAN&gt;.&lt;SPAN&gt;ModelDocument&lt;/SPAN&gt;.&lt;SPAN&gt;FullFileName&lt;/SPAN&gt;)

&lt;SPAN&gt;TableValues&lt;/SPAN&gt; = &lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;oModelDoc&lt;/SPAN&gt;, &lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"Routing Steps"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;If there is "SHEET METAL INSIDE FAB ASSY B/O" in he Routing Steps field, the table should look like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Routing Steps:&lt;/P&gt;&lt;P&gt;Sheet Metal&lt;/P&gt;&lt;P&gt;Inside Fab&lt;/P&gt;&lt;P&gt;ASSY B/O&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The most columns there will ever be is six.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Mar 2021 19:46:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-03-11T19:46:20Z</dc:date>
    <item>
      <title>Drawing Table</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-table/m-p/10149550#M122046</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to tables, but I'm assuming this takes an ilogic rule to make.&amp;nbsp; I need a table to appear on the top left of each drawing.&amp;nbsp; The table just on column and&amp;nbsp; the amount of rows it has depends on the number of objects written in an iproperty field.&amp;nbsp; &amp;nbsp;If the parts custom iproperty 'Routing Steps' = "`" then no table. Something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;oModelDoc&lt;/SPAN&gt; = &lt;SPAN&gt;IO&lt;/SPAN&gt;.&lt;SPAN&gt;Path&lt;/SPAN&gt;.&lt;SPAN&gt;GetFileName&lt;/SPAN&gt;(&lt;SPAN&gt;ThisDrawing&lt;/SPAN&gt;.&lt;SPAN&gt;ModelDocument&lt;/SPAN&gt;.&lt;SPAN&gt;FullFileName&lt;/SPAN&gt;)

&lt;SPAN&gt;TableValues&lt;/SPAN&gt; = &lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;oModelDoc&lt;/SPAN&gt;, &lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"Routing Steps"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;If there is "SHEET METAL INSIDE FAB ASSY B/O" in he Routing Steps field, the table should look like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Routing Steps:&lt;/P&gt;&lt;P&gt;Sheet Metal&lt;/P&gt;&lt;P&gt;Inside Fab&lt;/P&gt;&lt;P&gt;ASSY B/O&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The most columns there will ever be is six.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 19:46:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-table/m-p/10149550#M122046</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-11T19:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing Table</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-table/m-p/10149602#M122048</link>
      <description>&lt;P&gt;Here is an example iLogic rule that will create a new custom table that has 5 columns and 6 rows, and places it onto your 'active' drawing, and fills it in with generic data.&lt;/P&gt;&lt;P&gt;You can study this example to help you build your own custom table the way you want it.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("A Drawing Document must be active for this rule to work. Exiting.",vbOKOnly+vbCritical, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet

Dim oTitle As String = "CUSTOM TABLE TITLE"
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oPPoint As Point2d = oTG.CreatePoint2d(0, 0)
Dim oCols As Integer = 5
Dim oRows As Integer = 6
'Number of column titles supplied must match number of columns specified
'Dim oColTitles() As String = {" ", "Dimension L1", "Dimension L2", "Material", "Cost" }
'or
Dim oColTitles(oCols - 1) As String
oColTitles(0) = " " '1st column title
oColTitles(1) = "Column 2 Title" '2nd column title
oColTitles(2) = "Column 3 Title" '3rd column title
oColTitles(3) = "Material" '4th column title
oColTitles(4) = "Cost" '5th column title

'Contents must be a 'single dimension' array of String.
'the number of entries supplied in Contents must match the number of cells in the table
Dim oCells As Integer = (oCols * oRows) -1 'minus the 1, because an array starts at zero, instead of 1
Dim oContents(oCells) As String
For oCell As Integer = 0 To oCells
	oContents(oCell) = "Cell " &amp;amp; oCell
Next

'Dim oColWidths() As Double = {1.25, 2.5, 2.5, 1.5, 1.25 }
'or
'could run a function here to determine how wide each column needs to be, then set them individually
Dim oColWidths(oCols - 1) As Double
oColWidths(0) = 1.25 '1st column width
oColWidths(1) = 2.5
oColWidths(2) = 2.5
oColWidths(3) = 1.5
oColWidths(4) = 1.25 '5th column width

'Dim oRowHeights() As Double = {.25, .25, .25, .25, .25, .25 }
'or
'could run a function here to determine how tall each row needs to be, then set them individually
Dim oRowHeights(oRows - 1) As Double
For oRow As Integer = 0 To (oRows-1)
	oRowHeights(oRow) = .25
Next

Dim oCTable As CustomTable = oSheet.CustomTables.Add(oTitle, oPPoint, oCols, oRows, oColTitles, oContents, oColWidths, oRowHeights)&lt;/LI-CODE&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 or KUDOS) &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&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;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B166FEBB95D67CFA84899D32D8E17FC1/emoticons/1f4a1.png" alt=":light_bulb:" title=":light_bulb:" /&gt;&lt;/SPAN&gt;&lt;/A&gt;or you can Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 19:59:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-table/m-p/10149602#M122048</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-03-11T19:59:42Z</dc:date>
    </item>
  </channel>
</rss>

