<?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 Accessing BOM Quantity Type Through Apprentice? in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-bom-quantity-type-through-apprentice/m-p/9612549#M112787</link>
    <description>&lt;P&gt;I have a program that loops through an assembly using component occurrences in Inventor. The following code to access the BOM Quantity Type works fine in Inventor:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;oOcc.Definition.BOMQuantity.GetBaseQuantity(out qType, out qQTY);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to run the same code using Apprentice, I get the following error:&amp;nbsp;(Exception from HRESULT: 0x80004001 (E_NOTIMPL))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know if it is possible to access this property through apprentice? I have been able to access all other properties in the same way that I would with Inventor, until this error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Relevant section of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public void Loop(ComponentOccurrence oOcc)
{

BOMQuantityTypeEnum qType;
object qQTY;

oOcc.Definition.BOMQuantity.GetBaseQuantity(out qType, out qQTY);

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C# as programming language&lt;/P&gt;&lt;P&gt;Autodesk Inventor 2019, Build: 330, Release: 2019.4.1&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jul 2020 14:17:18 GMT</pubDate>
    <dc:creator>ckeveryga</dc:creator>
    <dc:date>2020-07-01T14:17:18Z</dc:date>
    <item>
      <title>Accessing BOM Quantity Type Through Apprentice?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-bom-quantity-type-through-apprentice/m-p/9612549#M112787</link>
      <description>&lt;P&gt;I have a program that loops through an assembly using component occurrences in Inventor. The following code to access the BOM Quantity Type works fine in Inventor:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;oOcc.Definition.BOMQuantity.GetBaseQuantity(out qType, out qQTY);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to run the same code using Apprentice, I get the following error:&amp;nbsp;(Exception from HRESULT: 0x80004001 (E_NOTIMPL))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know if it is possible to access this property through apprentice? I have been able to access all other properties in the same way that I would with Inventor, until this error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Relevant section of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public void Loop(ComponentOccurrence oOcc)
{

BOMQuantityTypeEnum qType;
object qQTY;

oOcc.Definition.BOMQuantity.GetBaseQuantity(out qType, out qQTY);

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C# as programming language&lt;/P&gt;&lt;P&gt;Autodesk Inventor 2019, Build: 330, Release: 2019.4.1&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 14:17:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-bom-quantity-type-through-apprentice/m-p/9612549#M112787</guid>
      <dc:creator>ckeveryga</dc:creator>
      <dc:date>2020-07-01T14:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing BOM Quantity Type Through Apprentice?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-bom-quantity-type-through-apprentice/m-p/9613678#M112813</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4145676"&gt;@ckeveryga&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have another way, you can refer. I use excel VBA to run with Inventor. I check QTY follow part number, before that i has QTY in excel, after that i place part in assy and check QTY them in BOM Inventor with excel.&lt;/P&gt;&lt;P&gt;If you more learn, please let me know.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub CheckQTY()
    Dim oWkbk As Workbook
    Set oWkbk = ThisWorkbook
    Dim oSheet As Worksheet
    Set oSheet = oWkbk.ActiveSheet
    Dim oInv As Inventor.Application
    Set oInv = GetObject(, "Inventor.Application")
    Dim oDoc As Document
    Set oDoc = oInv.ActiveDocument
    ' Set a reference to the assembly document.
    ' This assumes an assembly document is active.
    Dim oAssy As AssemblyDocument
    Set oAssy = oInv.ActiveDocument
    Dim sParamRange As String
        sParamRange = "A44:A200"
    ' Set a reference to the BOM
    Dim oBOM As BOM
    Set oBOM = oDoc.ComponentDefinition.BOM
    oBOM.StructuredViewEnabled = True
    oBOM.StructuredViewFirstLevelOnly = True ' Display First level
    oBOM.StructuredViewMinimumDigits = 3
    Dim oBOMView As BOMView
    Set oBOMView = oBOM.BOMViews.Item("Structured")
    Dim i As Integer
    For i = 1 To oBOMView.BOMRows.Count
        Dim oRow As BOMRow
        Set oRow = oBOMView.BOMRows.Item(i)
        Dim oCompDef As ComponentDefinition
        Set oCompDef = oRow.ComponentDefinitions.Item(1)
        Dim oPartNumProperty As Property
        Set oPartNumProperty = oCompDef.Document.PropertySets.Item("Design Tracking Properties").Item("Part Number")
        
        Dim oCell As Range
        For Each oCell In oSheet.Range(sParamRange)
            'If oCell.Value = oPartNumProperty.Value Then
            'oRow.ItemNumber = oCell.Offset(0, 1).Value
            'End If
            If oCell.Value = oPartNumProperty.Value Then
                If oCell.Offset(0, 2).Value = oRow.ItemQuantity Then
                oCell.Offset(0, 2).Interior.Color = RGB(0, 176, 240)
                Else
                oCell.Offset(0, 2).Interior.Color = RGB(255, 0, 0)
                End If
            End If
        Next oCell
    Next
    Range("A40").Select
    MsgBox ("Done!")
    oWkbk.Save
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2020 04:10:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-bom-quantity-type-through-apprentice/m-p/9613678#M112813</guid>
      <dc:creator>tonythm</dc:creator>
      <dc:date>2020-07-02T04:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing BOM Quantity Type Through Apprentice?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-bom-quantity-type-through-apprentice/m-p/9614501#M112847</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8622703"&gt;@tonythm&lt;/a&gt;&amp;nbsp;thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason I need to find the QTY Type using apprentice, is I have created a program outside of inventor that opens inventor in the background and exports multiple BOM's and drawings specific to my company's workflow. I would like to open apprentice instead of inventor as it is much faster for accessing part properties.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently able to access the QTY Type through Inventor (external program or VBA), but I cannot translate the same code to apprentice.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2020 13:21:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-bom-quantity-type-through-apprentice/m-p/9614501#M112847</guid>
      <dc:creator>ckeveryga</dc:creator>
      <dc:date>2020-07-02T13:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing BOM Quantity Type Through Apprentice?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-bom-quantity-type-through-apprentice/m-p/9623863#M112989</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4145676"&gt;@ckeveryga&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On running below code, throws &lt;STRONG&gt;System.NotImplementedException: 'Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL))&lt;/STRONG&gt;' error. It means that method is not implemented in apprentice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-csharp"&gt;&lt;CODE&gt;oOcc.Definition.BOMQuantity.GetBaseQuantity(out qType, out qQTY);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="Normal"&gt;The API exposed by &lt;FONT style="background-color: #0078d7;" color="#ffffff"&gt;Apprentice&lt;/FONT&gt; is a subset of the complete Autodesk Inventor API. &lt;FONT style="background-color: #0078d7;" color="#ffffff"&gt;Apprentice&lt;/FONT&gt; provides access to file references, assembly structure, B-Rep, geometry, attributes, render styles, and document properties. Access to the assembly structure, B-Rep, geometry, and render styles is read-only. Access to file references, attributes, and document properties is read and write.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="Normal"&gt;The primary differences between Autodesk Inventor and &lt;FONT style="background-color: #0078d7;" color="#ffffff"&gt;Apprentice&lt;/FONT&gt; are in the Application and Document objects. The objects that represent the Application and Document are completely different in Autodesk Inventor and &lt;FONT style="background-color: #0078d7;" color="#ffffff"&gt;Apprentice&lt;/FONT&gt;. The &lt;FONT style="background-color: #0078d7;" color="#ffffff"&gt;Apprentice&lt;/FONT&gt; Application object is called ApprenticeServerComponent. It supports a much more limited API than the Inventor Application object. In &lt;FONT style="background-color: #0078d7;" color="#ffffff"&gt;Apprentice&lt;/FONT&gt; there isn't a Documents collection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 11:37:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-bom-quantity-type-through-apprentice/m-p/9623863#M112989</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2020-07-08T11:37:37Z</dc:date>
    </item>
  </channel>
</rss>

