<?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: Running AutoDESK VB and getting an error in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7781075#M80478</link>
    <description>&lt;P&gt;for me it works perfect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table.PNG" style="width: 431px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/463581iB71F94C871B2ABE4/image-size/large?v=v2&amp;amp;px=999" role="button" title="table.PNG" alt="table.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2018 16:30:45 GMT</pubDate>
    <dc:creator>bradeneuropeArthur</dc:creator>
    <dc:date>2018-02-15T16:30:45Z</dc:date>
    <item>
      <title>Running AutoDESK VB and getting an error</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7775197#M80332</link>
      <description>&lt;P&gt;I found a snippet of code on the Knowledge.AutoDESK.com &lt;A href="https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2018/ENU/Inventor-API/files/CustomTables-Sample-htm.html" target="_blank"&gt;web site&lt;/A&gt;. I cut and pasted it into my VB editor and it produces the table as perscribed, but I get the a "string conversion" error. Anyone know why? It seems to be hanging up on line 13. I have posted a screen shot of the error and line of code.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 20:11:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7775197#M80332</guid>
      <dc:creator>RNDinov8r</dc:creator>
      <dc:date>2018-02-13T20:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Running AutoDESK VB and getting an error</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7775328#M80335</link>
      <description>Could you upload the code. I am missing something I think, but not sure.</description>
      <pubDate>Tue, 13 Feb 2018 20:58:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7775328#M80335</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2018-02-13T20:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Running AutoDESK VB and getting an error</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7775458#M80340</link>
      <description>&lt;P&gt;The link to the code was above in "web site", but if that's not working, here it is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Sub CreateCustomTable()
    &lt;SPAN&gt;&lt;SPAN&gt;' Set a reference to the drawing document.&lt;/SPAN&gt;&lt;/SPAN&gt;
    &lt;SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt; This assumes a drawing document is active.&lt;/SPAN&gt;
    Dim oDrawDoc As DrawingDocument
    Set oDrawDoc = ThisApplication.ActiveDocument
    
    &lt;SPAN&gt;&lt;SPAN&gt;' Set a reference to the active sheet.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    Dim oSheet As Sheet
    Set oSheet = oDrawDoc.ActiveSheet
    
    &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt; Set the column titles&lt;/SPAN&gt;
    Dim oTitles(1 To 3) As String
    oTitles(1) = &lt;SPAN&gt;"Part Number"&lt;/SPAN&gt;
    oTitles(2) = &lt;SPAN&gt;"Quantity"&lt;/SPAN&gt;
    oTitles(3) = &lt;SPAN&gt;"Material"&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;    Dim oContents(1 To 9) As String
    oContents(1) = "1"
    oContents(2) = "1"
    oContents(3) = "Brass"
    oContents(4) = "2"
    oContents(5) = "2"
    oContents(6) = "Aluminium"
    oContents(7) = "3"
    oContents(8) = "1"
    oContents(9) = "Steel"
    
    &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt; Set the column widths (defaults to the column title width &lt;SPAN&gt;if&lt;/SPAN&gt; not specified)&lt;/SPAN&gt;
    Dim oColumnWidths(1 To 3) As Double
    oColumnWidths(1) = 2.5
    oColumnWidths(2) = 2.5
    oColumnWidths(3) = 4
      
    &lt;SPAN&gt;&lt;SPAN&gt;' Create the custom table&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    Dim oCustomTable As CustomTable
    Set oCustomTable = oSheet.CustomTables.Add("My Table", ThisApplication.TransientGeometry.CreatePoint2d(15, 15), _
                                        3, 3, oTitles, oContents, oColumnWidths)
                                        
    &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt; Change the 3rd column to be left justified.&lt;/SPAN&gt;
    oCustomTable.Columns.Item(3).ValueHorizontalJustification = kAlignTextLeft
    
    &lt;SPAN&gt;&lt;SPAN&gt;' Create a table format object&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    Dim oFormat As TableFormat
    Set oFormat = oSheet.CustomTables.CreateTableFormat
    
    &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt; Set inside line color to red.&lt;/SPAN&gt;
    oFormat.InsideLineColor = ThisApplication.TransientObjects.CreateColor(255, 0, 0)
    
    &lt;SPAN&gt;&lt;SPAN&gt;' Set outside line weight.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    oFormat.OutsideLineWeight = 0.1
    
    &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt; Modify the table formats&lt;/SPAN&gt;
    oCustomTable.OverrideFormat = oFormat
End Sub&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Feb 2018 21:32:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7775458#M80340</guid>
      <dc:creator>RNDinov8r</dc:creator>
      <dc:date>2018-02-13T21:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Running AutoDESK VB and getting an error</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7778691#M80391</link>
      <description>&lt;P&gt;I don't see the link between the picture and the code you send.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cstr(Manifold_QTY) = Man_QTY looks not correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cstr = convert to string....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so you try te convert the variable and try to set it with Man_QTY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is Manifold_QTY a string or an integer?&lt;/P&gt;
&lt;P&gt;try&lt;/P&gt;
&lt;P&gt;Dim Manifold_QTY as string&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then&lt;/P&gt;
&lt;P&gt;Manifold_QTY = Cstr(Man_QTY)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if Man_QTY is an integer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if this does not help, send the right code..&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 21:49:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7778691#M80391</guid>
      <dc:creator>HermJan.Otterman</dc:creator>
      <dc:date>2018-02-14T21:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Running AutoDESK VB and getting an error</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7780449#M80445</link>
      <description>&lt;P&gt;Okay, this is embarrassing...after going through the code, I couldn't find variables you were talking about. Turns out, the confusion was because I posted the wrong screen shot. This is what the screen shot should have been. (see attached) I apologize for the confusion.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 13:58:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7780449#M80445</guid>
      <dc:creator>RNDinov8r</dc:creator>
      <dc:date>2018-02-15T13:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Running AutoDESK VB and getting an error</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7780474#M80447</link>
      <description>&lt;P&gt;The following code works for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Sub CreateCustomTable()
    ' 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 3) As String
    oTitles(1) = "Part Number"
    oTitles(2) = "Quantity"
    oTitles(3) = "Material"
    
    ' Set the contents of the custom table (contents are set row-wise)
    Dim oContents(1 To 9) As String
    oContents(1) = "1"
    oContents(2) = "1"
    oContents(3) = "Brass"
    oContents(4) = "2"
    oContents(5) = "2"
    oContents(6) = "Aluminium"
    oContents(7) = "3"
    oContents(8) = "1"
    oContents(9) = "Steel"
    
    ' Set the column widths (defaults to the column title width if not specified)
    Dim oColumnWidths(1 To 3) As Double
    oColumnWidths(1) = 2.5
    oColumnWidths(2) = 2.5
    oColumnWidths(3) = 4
      
    ' Create the custom table
    Dim oCustomTable As CustomTable
    Set oCustomTable = oSheet.CustomTables.Add("My Table", ThisApplication.TransientGeometry.CreatePoint2d(15, 15), _
                                        3, 3, oTitles, oContents, oColumnWidths)
                                        
    ' Change the 3rd column to be left justified.
    oCustomTable.Columns.Item(3).ValueHorizontalJustification = kAlignTextLeft
    
    ' Create a table format object
    Dim oFormat As TableFormat
    Set oFormat = oSheet.CustomTables.CreateTableFormat
    
    ' Set inside line color to red.
    oFormat.InsideLineColor = ThisApplication.TransientObjects.CreateColor(255, 0, 0)
    
    ' Set outside line weight.
    oFormat.OutsideLineWeight = 0.1
    
    ' Modify the table formats
    oCustomTable.OverrideFormat = oFormat
End Sub&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Feb 2018 14:04:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7780474#M80447</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2018-02-15T14:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Running AutoDESK VB and getting an error</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7781070#M80477</link>
      <description>&lt;P&gt;So, Unless I am missing something...you didn't change the code, but when I run it, as you can see in the &lt;A href="https://www.screencast.com/t/hx6U7xMgGM9" target="_blank"&gt;screen cast&lt;/A&gt;&amp;nbsp;(see hyperlink), I get a run-time error. It creates the table, but I get an error. It only occurs when I run &lt;EM&gt;that&lt;/EM&gt; macro. The other macro I can run, "Tag Labeler", in my iLogic form does not give me issues. I also have have attached an image of the "error explanation".&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 16:27:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7781070#M80477</guid>
      <dc:creator>RNDinov8r</dc:creator>
      <dc:date>2018-02-15T16:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Running AutoDESK VB and getting an error</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7781075#M80478</link>
      <description>&lt;P&gt;for me it works perfect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table.PNG" style="width: 431px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/463581iB71F94C871B2ABE4/image-size/large?v=v2&amp;amp;px=999" role="button" title="table.PNG" alt="table.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 16:30:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-autodesk-vb-and-getting-an-error/m-p/7781075#M80478</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2018-02-15T16:30:45Z</dc:date>
    </item>
  </channel>
</rss>

