<?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 Inventor inspection sheet auto populate dimensions and replacing with relative location letters in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-inspection-sheet-auto-populate-dimensions-and-replacing/m-p/11851655#M150615</link>
    <description>&lt;P&gt;Hi, i am trying to write a rule with Inventor iLogic 2023 to create an inspection table that takes dimensions or annotations from the sheet and auto populates a table with them,&amp;nbsp; when I run the code it is saying&amp;nbsp;Public member 'Tables' on type 'Sheet' not found. how would I go about fixing this code. I am relatively new at coding&lt;BR /&gt;&lt;BR /&gt;my current code is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Imports Inventor&lt;/P&gt;&lt;P&gt;Imports Inventor.Text&lt;/P&gt;&lt;P&gt;Imports Inventor.Drawing&lt;/P&gt;&lt;P&gt;Imports Inventor.Annotation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub Main()&lt;/P&gt;&lt;P&gt;'Get active document and current sheet&lt;/P&gt;&lt;P&gt;Dim doc As DrawingDocument = ThisApplication.ActiveDocument&lt;/P&gt;&lt;P&gt;Dim sheet As Sheet = doc.ActiveSheet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Create new table&lt;BR /&gt;Dim oCustomTable As CustomTable = sheet.CustomTables.Add("MyTable", sheet.CenterBlock.Position, 4, 1, {"Location", "Dimension", "As Built", "Inspected"})&lt;/P&gt;&lt;P&gt;'Add rows to table for each dimension set&lt;BR /&gt;Dim index As Integer = 1&lt;BR /&gt;For Each dimSet As DimensionSet In sheet.DimensionSets&lt;BR /&gt;Dim location As String = GetLocationName(index)&lt;BR /&gt;Dim asBuilt As String = ""&lt;BR /&gt;Dim inspected As String = ""&lt;BR /&gt;&lt;BR /&gt;'Get dimensions from dimension set&lt;BR /&gt;For Each dim As Dimension In dimSet.OfType(Of Dimension)()&lt;BR /&gt;'Get dimension value&lt;BR /&gt;Dim value As String = dim.Parameter.ValueAsString&lt;BR /&gt;&lt;BR /&gt;'Add dimension to table row based on its text&lt;BR /&gt;Select Case dim.Text&lt;BR /&gt;Case "As Built"&lt;BR /&gt;asBuilt = value&lt;BR /&gt;Case "Inspected"&lt;BR /&gt;inspected = value&lt;BR /&gt;Case Else&lt;BR /&gt;oCustomTable.Resize(oCustomTable.Rows.Count + 1, oCustomTable.Columns.Count)&lt;BR /&gt;oCustomTable.Cell(oCustomTable.Rows.Count, 1).Value = location&lt;BR /&gt;oCustomTable.Cell(oCustomTable.Rows.Count, 2).Value = value&lt;BR /&gt;End Select&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;'Add row to table for "As Built" dimension&lt;BR /&gt;oCustomTable.Resize(oCustomTable.Rows.Count + 1, oCustomTable.Columns.Count)&lt;BR /&gt;oCustomTable.Cell(oCustomTable.Rows.Count, 1).Value = location&lt;BR /&gt;oCustomTable.Cell(oCustomTable.Rows.Count, 3).Value = asBuilt&lt;BR /&gt;&lt;BR /&gt;'Add row to table for "Inspected" dimension&lt;BR /&gt;oCustomTable.Resize(oCustomTable.Rows.Count + 1, oCustomTable.Columns.Count)&lt;BR /&gt;oCustomTable.Cell(oCustomTable.Rows.Count, 1).Value = location&lt;BR /&gt;oCustomTable.Cell(oCustomTable.Rows.Count, 4).Value = inspected&lt;BR /&gt;&lt;BR /&gt;index += 1&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;'Delete all dimensions from sheet&lt;BR /&gt;For Each dim As Dimension In sheet.DimensionConstraints.OfType(Of Dimension)()&lt;BR /&gt;dim.Delete()&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;'Replace text in dimensions with letters&lt;BR /&gt;index = 1&lt;BR /&gt;For Each dimSet As DimensionSet In sheet.DimensionSets&lt;BR /&gt;For Each dim As Dimension In dimSet.OfType(Of Dimension)()&lt;BR /&gt;Dim letter As String = GetLetter(index)&lt;BR /&gt;Dim text As TextBox = Nothing&lt;BR /&gt;Dim position As Point2d = dim.CenterPoint&lt;/P&gt;&lt;P&gt;'Add new text box with letter&lt;BR /&gt;text = sheet.TextBoxes.Add(position, letter)&lt;BR /&gt;text.Style = doc.Styles.GeneralNoteStyle&lt;BR /&gt;text.ScaleMode = TextScaleModeEnum.kFitScale&lt;BR /&gt;text.FitDirection = TextFitDirectionEnum.kFitHorizontal&lt;/P&gt;&lt;P&gt;index += 1&lt;BR /&gt;Next&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Function GetLocationName(index As Integer) As String 'Get alphabet character for index (1=A, 2=B, etc.) Dim character As Char = Chr(64 + index)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;'If character is beyond "Z", append "A" to result and decrement index&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;If&lt;/SPAN&gt;&lt;SPAN&gt; character = &lt;/SPAN&gt;&lt;SPAN class=""&gt;"["c&lt;/SPAN&gt; &lt;SPAN class=""&gt;Then&lt;/SPAN&gt;&lt;SPAN&gt; index -= &lt;/SPAN&gt;&lt;SPAN class=""&gt;26&lt;/SPAN&gt;&lt;SPAN&gt; character = &lt;/SPAN&gt;&lt;SPAN class=""&gt;"A"c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;End&lt;/SPAN&gt; &lt;SPAN class=""&gt;If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;'Return character or character pair for index&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;If&lt;/SPAN&gt;&lt;SPAN&gt; index &amp;gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;26&lt;/SPAN&gt; &lt;SPAN class=""&gt;Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Return&lt;/SPAN&gt;&lt;SPAN&gt; GetLocationName(Int((index - &lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;) / &lt;/SPAN&gt;&lt;SPAN class=""&gt;26&lt;/SPAN&gt;&lt;SPAN&gt;)) &amp;amp; character &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Else&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Mar 2023 20:03:12 GMT</pubDate>
    <dc:creator>Walker2859</dc:creator>
    <dc:date>2023-03-27T20:03:12Z</dc:date>
    <item>
      <title>Inventor inspection sheet auto populate dimensions and replacing with relative location letters</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-inspection-sheet-auto-populate-dimensions-and-replacing/m-p/11851655#M150615</link>
      <description>&lt;P&gt;Hi, i am trying to write a rule with Inventor iLogic 2023 to create an inspection table that takes dimensions or annotations from the sheet and auto populates a table with them,&amp;nbsp; when I run the code it is saying&amp;nbsp;Public member 'Tables' on type 'Sheet' not found. how would I go about fixing this code. I am relatively new at coding&lt;BR /&gt;&lt;BR /&gt;my current code is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Imports Inventor&lt;/P&gt;&lt;P&gt;Imports Inventor.Text&lt;/P&gt;&lt;P&gt;Imports Inventor.Drawing&lt;/P&gt;&lt;P&gt;Imports Inventor.Annotation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub Main()&lt;/P&gt;&lt;P&gt;'Get active document and current sheet&lt;/P&gt;&lt;P&gt;Dim doc As DrawingDocument = ThisApplication.ActiveDocument&lt;/P&gt;&lt;P&gt;Dim sheet As Sheet = doc.ActiveSheet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Create new table&lt;BR /&gt;Dim oCustomTable As CustomTable = sheet.CustomTables.Add("MyTable", sheet.CenterBlock.Position, 4, 1, {"Location", "Dimension", "As Built", "Inspected"})&lt;/P&gt;&lt;P&gt;'Add rows to table for each dimension set&lt;BR /&gt;Dim index As Integer = 1&lt;BR /&gt;For Each dimSet As DimensionSet In sheet.DimensionSets&lt;BR /&gt;Dim location As String = GetLocationName(index)&lt;BR /&gt;Dim asBuilt As String = ""&lt;BR /&gt;Dim inspected As String = ""&lt;BR /&gt;&lt;BR /&gt;'Get dimensions from dimension set&lt;BR /&gt;For Each dim As Dimension In dimSet.OfType(Of Dimension)()&lt;BR /&gt;'Get dimension value&lt;BR /&gt;Dim value As String = dim.Parameter.ValueAsString&lt;BR /&gt;&lt;BR /&gt;'Add dimension to table row based on its text&lt;BR /&gt;Select Case dim.Text&lt;BR /&gt;Case "As Built"&lt;BR /&gt;asBuilt = value&lt;BR /&gt;Case "Inspected"&lt;BR /&gt;inspected = value&lt;BR /&gt;Case Else&lt;BR /&gt;oCustomTable.Resize(oCustomTable.Rows.Count + 1, oCustomTable.Columns.Count)&lt;BR /&gt;oCustomTable.Cell(oCustomTable.Rows.Count, 1).Value = location&lt;BR /&gt;oCustomTable.Cell(oCustomTable.Rows.Count, 2).Value = value&lt;BR /&gt;End Select&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;'Add row to table for "As Built" dimension&lt;BR /&gt;oCustomTable.Resize(oCustomTable.Rows.Count + 1, oCustomTable.Columns.Count)&lt;BR /&gt;oCustomTable.Cell(oCustomTable.Rows.Count, 1).Value = location&lt;BR /&gt;oCustomTable.Cell(oCustomTable.Rows.Count, 3).Value = asBuilt&lt;BR /&gt;&lt;BR /&gt;'Add row to table for "Inspected" dimension&lt;BR /&gt;oCustomTable.Resize(oCustomTable.Rows.Count + 1, oCustomTable.Columns.Count)&lt;BR /&gt;oCustomTable.Cell(oCustomTable.Rows.Count, 1).Value = location&lt;BR /&gt;oCustomTable.Cell(oCustomTable.Rows.Count, 4).Value = inspected&lt;BR /&gt;&lt;BR /&gt;index += 1&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;'Delete all dimensions from sheet&lt;BR /&gt;For Each dim As Dimension In sheet.DimensionConstraints.OfType(Of Dimension)()&lt;BR /&gt;dim.Delete()&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;'Replace text in dimensions with letters&lt;BR /&gt;index = 1&lt;BR /&gt;For Each dimSet As DimensionSet In sheet.DimensionSets&lt;BR /&gt;For Each dim As Dimension In dimSet.OfType(Of Dimension)()&lt;BR /&gt;Dim letter As String = GetLetter(index)&lt;BR /&gt;Dim text As TextBox = Nothing&lt;BR /&gt;Dim position As Point2d = dim.CenterPoint&lt;/P&gt;&lt;P&gt;'Add new text box with letter&lt;BR /&gt;text = sheet.TextBoxes.Add(position, letter)&lt;BR /&gt;text.Style = doc.Styles.GeneralNoteStyle&lt;BR /&gt;text.ScaleMode = TextScaleModeEnum.kFitScale&lt;BR /&gt;text.FitDirection = TextFitDirectionEnum.kFitHorizontal&lt;/P&gt;&lt;P&gt;index += 1&lt;BR /&gt;Next&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Function GetLocationName(index As Integer) As String 'Get alphabet character for index (1=A, 2=B, etc.) Dim character As Char = Chr(64 + index)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;'If character is beyond "Z", append "A" to result and decrement index&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;If&lt;/SPAN&gt;&lt;SPAN&gt; character = &lt;/SPAN&gt;&lt;SPAN class=""&gt;"["c&lt;/SPAN&gt; &lt;SPAN class=""&gt;Then&lt;/SPAN&gt;&lt;SPAN&gt; index -= &lt;/SPAN&gt;&lt;SPAN class=""&gt;26&lt;/SPAN&gt;&lt;SPAN&gt; character = &lt;/SPAN&gt;&lt;SPAN class=""&gt;"A"c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;End&lt;/SPAN&gt; &lt;SPAN class=""&gt;If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;'Return character or character pair for index&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;If&lt;/SPAN&gt;&lt;SPAN&gt; index &amp;gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;26&lt;/SPAN&gt; &lt;SPAN class=""&gt;Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Return&lt;/SPAN&gt;&lt;SPAN&gt; GetLocationName(Int((index - &lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;) / &lt;/SPAN&gt;&lt;SPAN class=""&gt;26&lt;/SPAN&gt;&lt;SPAN&gt;)) &amp;amp; character &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Else&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 20:03:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-inspection-sheet-auto-populate-dimensions-and-replacing/m-p/11851655#M150615</guid>
      <dc:creator>Walker2859</dc:creator>
      <dc:date>2023-03-27T20:03:12Z</dc:date>
    </item>
  </channel>
</rss>

