<?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 Coordinate table on drawing in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-table-on-drawing/m-p/2702405#M143266</link>
    <description>&lt;P&gt;I have created some reference points on a part. I have a need to include a table on the drawing of this part that shows the x,y,z coordinate positions of each of those points relative to the coordinate system origin. I have been trying to figure out a way to&amp;nbsp;extract this information from the part to create source data&amp;nbsp;to place into a table on the drawing. Does anyone know of a way to do this?&lt;/P&gt;</description>
    <pubDate>Sat, 26 Jun 2010 00:02:02 GMT</pubDate>
    <dc:creator>jcoveyou</dc:creator>
    <dc:date>2010-06-26T00:02:02Z</dc:date>
    <item>
      <title>Coordinate table on drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-table-on-drawing/m-p/2702405#M143266</link>
      <description>&lt;P&gt;I have created some reference points on a part. I have a need to include a table on the drawing of this part that shows the x,y,z coordinate positions of each of those points relative to the coordinate system origin. I have been trying to figure out a way to&amp;nbsp;extract this information from the part to create source data&amp;nbsp;to place into a table on the drawing. Does anyone know of a way to do this?&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jun 2010 00:02:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-table-on-drawing/m-p/2702405#M143266</guid>
      <dc:creator>jcoveyou</dc:creator>
      <dc:date>2010-06-26T00:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate table on drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-table-on-drawing/m-p/2703727#M143267</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know if your points are CenterMarks in your Drawing. If so, try this (quick and dirty) one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Sub CreateCustomCenterMarkTable()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Set a reference to the drawing document.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' This assumes a drawing document is active.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oDrawDoc As DrawingDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oDrawDoc = ThisApplication.ActiveDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Set a reference to the active sheet.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oSheet As Sheet&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oSheet = oDrawDoc.ActiveSheet&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Set the column titles&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oTitles(1 To 3) As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oTitles(1) = "X"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oTitles(2) = "Y"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oTitles(3) = "Z"&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Set the contents of the custom table (contents are set row-wise)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oCenterMark As Centermark&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oPoint As Point&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim i As Integer&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = oSheet.Centermarks.Count * 3&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReDim oContents(1 To i) As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each oCenterMark In oDrawDoc.ActiveSheet.Centermarks&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oPoint = oCenterMark.ModelWorkFeature.Point&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oContents(i) = oPoint.X&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = i + 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oContents(i) = oPoint.Y&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = i + 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oContents(i) = oPoint.Z&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = i + 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Debug.Print oPoint.X &amp;amp; ", " &amp;amp; oPoint.Y &amp;amp; ", " &amp;amp; oPoint.Z&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Set the column widths (defaults to the column title width if not specified)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oColumnWidths(1 To 3) As Double&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oColumnWidths(1) = 2.5&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oColumnWidths(2) = 2.5&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oColumnWidths(3) = 4&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Create the custom table&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oCustomTable As CustomTable&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oCustomTable = oSheet.CustomTables.Add("My Table", ThisApplication.TransientGeometry.CreatePoint2d(15, 15), 3, oSheet.Centermarks.Count, oTitles, oContents, oColumnWidths)&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2010 22:26:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-table-on-drawing/m-p/2703727#M143267</guid>
      <dc:creator>Ralf_Krieg</dc:creator>
      <dc:date>2010-06-28T22:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate table on drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-table-on-drawing/m-p/3465954#M143268</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is it also possible to get the name of each Point (centermark)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2012 16:21:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-table-on-drawing/m-p/3465954#M143268</guid>
      <dc:creator>Frodl</dc:creator>
      <dc:date>2012-05-21T16:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate table on drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-table-on-drawing/m-p/3466116#M143269</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now with first column "Name"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Sub CreateCustomCenterMarkTable()
    ' Set a reference to the drawing document.
    ' This assumes a drawing document is active.
    Dim oDrawDoc As DrawingDocument
    Set oDrawDoc = ThisApplication.ActiveDocument
    
    ' Set a reference to the active sheet.
    Dim oSheet As Sheet
    Set oSheet = oDrawDoc.ActiveSheet
    
    ' Set the column titles
    Dim oTitles(1 To 4) As String
    oTitles(1) = "Name"
    oTitles(2) = "X (cm)"
    oTitles(3) = "Y (cm)"
    oTitles(4) = "Z (cm)"
    
    
    ' Set the contents of the custom table (contents are set row-wise)
    Dim oCenterMark As Centermark
    Dim oPoint As Point
    Dim i As Integer
    i = oSheet.Centermarks.Count * 4
    ReDim oContents(1 To i) As String
    i = 1
    
    For Each oCenterMark In oDrawDoc.ActiveSheet.Centermarks
        Set oPoint = oCenterMark.ModelWorkFeature.Point
        oContents(i) = oCenterMark.ModelWorkFeature.Name
        i = i + 1
        oContents(i) = Round(oPoint.X, 2)
        i = i + 1
        oContents(i) = Round(oPoint.Y, 2)
        i = i + 1
        oContents(i) = Round(oPoint.Z, 2)
        i = i + 1
        'Debug.Print oPoint.X &amp;amp; ", " &amp;amp; oPoint.Y &amp;amp; ", " &amp;amp; oPoint.Z
    Next
    
    ' Set the column widths (defaults to the column title width if not specified)
    Dim oColumnWidths(1 To 4) As Double
    oColumnWidths(1) = 8
    oColumnWidths(2) = 2.5
    oColumnWidths(3) = 2.5
    oColumnWidths(4) = 2.5
      
    ' Create the custom table
    Dim oCustomTable As CustomTable
    Set oCustomTable = oSheet.CustomTables.Add("My Table", ThisApplication.TransientGeometry.CreatePoint2d(15, 15), 4, oSheet.Centermarks.Count, oTitles, oContents, oColumnWidths)

End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2012 17:46:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-table-on-drawing/m-p/3466116#M143269</guid>
      <dc:creator>Ralf_Krieg</dc:creator>
      <dc:date>2012-05-21T17:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate table on drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-table-on-drawing/m-p/4978358#M143270</link>
      <description>&lt;P&gt;I tried that code in Inventor 2014, and it states it needs a sub main&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2014 05:56:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/coordinate-table-on-drawing/m-p/4978358#M143270</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-04-22T05:56:02Z</dc:date>
    </item>
  </channel>
</rss>

