<?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: in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760044#M169147</link>
    <description>oPCompRef.Enabled - produces a runtime error 438 - Object doesn't support&lt;BR /&gt;
property or method.&lt;BR /&gt;
&lt;BR /&gt;
My quesion is, what if there are three identical parts and only two are&lt;BR /&gt;
enabled?  Can the count work differently?  If not, I can deal with it, but&lt;BR /&gt;
what exactly is missing from your if statement below?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your response!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Kent Keller" &lt;KENT&gt; wrote in message&lt;BR /&gt;
news:BDB8F35A0F117F4202EBE876A5D12228@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; If I understand correctly it should just be something like this&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     For Each oPCompRef In oPCompRefs&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;         PartNo = Left((oPCompRef.ReferencedFileDescriptor.DisplayName),&lt;BR /&gt;
&amp;gt; &amp;gt; Len(oPCompRef.ReferencedFileDescriptor.DisplayName) - 4)&lt;BR /&gt;
&amp;gt;         if oPCompRef.Enabled = True then&lt;BR /&gt;
&amp;gt; &amp;gt;         QTY = oPCompRef.ImmediateOccurrences.Count&lt;BR /&gt;
&amp;gt;         end if&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Kent&lt;BR /&gt;
&amp;gt; Assistant Moderator&lt;BR /&gt;
&amp;gt; Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Stephen Anderson" &lt;SANDERS.TECH&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:45822FE41694A75528C8C449DDCA30DE@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; I have an assembly where I count parts and place them in a database.&lt;BR /&gt;
&amp;gt; &amp;gt; Currently, I am counting all parts (by name).  I would like to exclude&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; &amp;gt; parts where the snabled feature is turned off in the specific assembly.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     For Each oPCompRef In oPCompRefs&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;         PartNo = Left((oPCompRef.ReferencedFileDescriptor.DisplayName),&lt;BR /&gt;
&amp;gt; &amp;gt; Len(oPCompRef.ReferencedFileDescriptor.DisplayName) - 4)&lt;BR /&gt;
&amp;gt; &amp;gt;         QTY = oPCompRef.ImmediateOccurrences.Count&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; I am thinking possibly, that changing the QTY variable to ount&lt;BR /&gt;
differently&lt;BR /&gt;
&amp;gt; &amp;gt; might be a viable solution.  On the other hand, perhaps there is another&lt;BR /&gt;
if&lt;BR /&gt;
&amp;gt; &amp;gt; agrument that must be added???&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Thanks in advance for your help!&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;           Steve Anderson&lt;BR /&gt;
&amp;gt; &amp;gt;           Engineer / Documentation Coordinator       _&lt;BR /&gt;
&amp;gt; &amp;gt; METRO MACHINE &amp;amp; ENGINEERING CORP.&lt;BR /&gt;
&amp;gt; &amp;gt; vmail: (952) 259-3683  fax: (952) 937-2374&lt;BR /&gt;
&amp;gt; &amp;gt; email: sanders.tec@netzero.com&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; -- NOTE NEW EMAIL ADDRESS --&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/SANDERS.TECH&gt;&lt;/KENT&gt;</description>
    <pubDate>Thu, 28 Aug 2003 09:49:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2003-08-28T09:49:48Z</dc:date>
    <item>
      <title>Differentiate enabled vs disabled parts in Assembly using VBA</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760041#M169144</link>
      <description>I have an assembly where I count parts and place them in a database.&lt;BR /&gt;
Currently, I am counting all parts (by name).  I would like to exclude the&lt;BR /&gt;
parts where the snabled feature is turned off in the specific assembly.&lt;BR /&gt;
&lt;BR /&gt;
    For Each oPCompRef In oPCompRefs&lt;BR /&gt;
&lt;BR /&gt;
        PartNo = Left((oPCompRef.ReferencedFileDescriptor.DisplayName),&lt;BR /&gt;
Len(oPCompRef.ReferencedFileDescriptor.DisplayName) - 4)&lt;BR /&gt;
        QTY = oPCompRef.ImmediateOccurrences.Count&lt;BR /&gt;
&lt;BR /&gt;
I am thinking possibly, that changing the QTY variable to ount differently&lt;BR /&gt;
might be a viable solution.  On the other hand, perhaps there is another if&lt;BR /&gt;
agrument that must be added???&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance for your help!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
          Steve Anderson&lt;BR /&gt;
          Engineer / Documentation Coordinator       _&lt;BR /&gt;
METRO MACHINE &amp;amp; ENGINEERING CORP.&lt;BR /&gt;
vmail: (952) 259-3683  fax: (952) 937-2374&lt;BR /&gt;
email: sanders.tec@netzero.com&lt;BR /&gt;
&lt;BR /&gt;
-- NOTE NEW EMAIL ADDRESS --</description>
      <pubDate>Thu, 28 Aug 2003 08:08:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760041#M169144</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-08-28T08:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Differentiate enabled vs disabled parts in Assembly using VBA</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760042#M169145</link>
      <description>If I understand correctly it should just be something like this&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;     For Each oPCompRef In oPCompRefs&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;         PartNo = Left((oPCompRef.ReferencedFileDescriptor.DisplayName),&lt;BR /&gt;
&amp;gt; Len(oPCompRef.ReferencedFileDescriptor.DisplayName) - 4)&lt;BR /&gt;
        if oPCompRef.Enabled = True then&lt;BR /&gt;
&amp;gt;         QTY = oPCompRef.ImmediateOccurrences.Count&lt;BR /&gt;
        end if&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Kent&lt;BR /&gt;
Assistant Moderator&lt;BR /&gt;
Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Stephen Anderson" &lt;SANDERS.TECH&gt; wrote in message&lt;BR /&gt;
news:45822FE41694A75528C8C449DDCA30DE@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I have an assembly where I count parts and place them in a database.&lt;BR /&gt;
&amp;gt; Currently, I am counting all parts (by name).  I would like to exclude the&lt;BR /&gt;
&amp;gt; parts where the snabled feature is turned off in the specific assembly.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     For Each oPCompRef In oPCompRefs&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;         PartNo = Left((oPCompRef.ReferencedFileDescriptor.DisplayName),&lt;BR /&gt;
&amp;gt; Len(oPCompRef.ReferencedFileDescriptor.DisplayName) - 4)&lt;BR /&gt;
&amp;gt;         QTY = oPCompRef.ImmediateOccurrences.Count&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I am thinking possibly, that changing the QTY variable to ount differently&lt;BR /&gt;
&amp;gt; might be a viable solution.  On the other hand, perhaps there is another if&lt;BR /&gt;
&amp;gt; agrument that must be added???&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks in advance for your help!&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;           Steve Anderson&lt;BR /&gt;
&amp;gt;           Engineer / Documentation Coordinator       _&lt;BR /&gt;
&amp;gt; METRO MACHINE &amp;amp; ENGINEERING CORP.&lt;BR /&gt;
&amp;gt; vmail: (952) 259-3683  fax: (952) 937-2374&lt;BR /&gt;
&amp;gt; email: sanders.tec@netzero.com&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; -- NOTE NEW EMAIL ADDRESS --&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/SANDERS.TECH&gt;</description>
      <pubDate>Thu, 28 Aug 2003 08:21:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760042#M169145</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-08-28T08:21:50Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760043#M169146</link>
      <description>Kent is close, but there's a slight change that's needed.  Try this:&lt;BR /&gt;
&lt;BR /&gt;
Public Sub CountEnabled()&lt;BR /&gt;
    Dim oDoc As AssemblyDocument&lt;BR /&gt;
    Set oDoc = ThisApplication.ActiveDocument&lt;BR /&gt;
&lt;BR /&gt;
    Dim oCompRef As ComponentDefinitionReference&lt;BR /&gt;
    For Each oCompRef In&lt;BR /&gt;
oDoc.ComponentDefinition.ImmediateReferencedDefinitions&lt;BR /&gt;
        Dim iQty As Long&lt;BR /&gt;
        iQty = 0&lt;BR /&gt;
        Dim oOcc As ComponentOccurrence&lt;BR /&gt;
        For Each oOcc In oCompRef.ImmediateOccurrences&lt;BR /&gt;
            If oOcc.Enabled Then&lt;BR /&gt;
                iQty = iQty + 1&lt;BR /&gt;
            End If&lt;BR /&gt;
        Next&lt;BR /&gt;
&lt;BR /&gt;
        Dim strPartNo As String&lt;BR /&gt;
        strPartNo = Left((oCompRef.ReferencedFileDescriptor.DisplayName),&lt;BR /&gt;
Len(oCompRef.ReferencedFileDescriptor.DisplayName) - 4)&lt;BR /&gt;
&lt;BR /&gt;
        Debug.Print strPartNo &amp;amp; ", Qty: " &amp;amp; iQty&lt;BR /&gt;
    Next&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Brian Ekins&lt;BR /&gt;
Developer Technical Services, Autodesk&lt;BR /&gt;
Discussion Q&amp;amp;A: http://www.autodesk.com/discussion&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Kent Keller" &lt;KENT&gt; wrote in message&lt;BR /&gt;
news:BDB8F35A0F117F4202EBE876A5D12228@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; If I understand correctly it should just be something like this&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     For Each oPCompRef In oPCompRefs&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;         PartNo = Left((oPCompRef.ReferencedFileDescriptor.DisplayName),&lt;BR /&gt;
&amp;gt; &amp;gt; Len(oPCompRef.ReferencedFileDescriptor.DisplayName) - 4)&lt;BR /&gt;
&amp;gt;         if oPCompRef.Enabled = True then&lt;BR /&gt;
&amp;gt; &amp;gt;         QTY = oPCompRef.ImmediateOccurrences.Count&lt;BR /&gt;
&amp;gt;         end if&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Kent&lt;BR /&gt;
&amp;gt; Assistant Moderator&lt;BR /&gt;
&amp;gt; Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Stephen Anderson" &lt;SANDERS.TECH&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:45822FE41694A75528C8C449DDCA30DE@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; I have an assembly where I count parts and place them in a database.&lt;BR /&gt;
&amp;gt; &amp;gt; Currently, I am counting all parts (by name).  I would like to exclude&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; &amp;gt; parts where the snabled feature is turned off in the specific assembly.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     For Each oPCompRef In oPCompRefs&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;         PartNo = Left((oPCompRef.ReferencedFileDescriptor.DisplayName),&lt;BR /&gt;
&amp;gt; &amp;gt; Len(oPCompRef.ReferencedFileDescriptor.DisplayName) - 4)&lt;BR /&gt;
&amp;gt; &amp;gt;         QTY = oPCompRef.ImmediateOccurrences.Count&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; I am thinking possibly, that changing the QTY variable to ount&lt;BR /&gt;
differently&lt;BR /&gt;
&amp;gt; &amp;gt; might be a viable solution.  On the other hand, perhaps there is another&lt;BR /&gt;
if&lt;BR /&gt;
&amp;gt; &amp;gt; agrument that must be added???&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Thanks in advance for your help!&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;           Steve Anderson&lt;BR /&gt;
&amp;gt; &amp;gt;           Engineer / Documentation Coordinator       _&lt;BR /&gt;
&amp;gt; &amp;gt; METRO MACHINE &amp;amp; ENGINEERING CORP.&lt;BR /&gt;
&amp;gt; &amp;gt; vmail: (952) 259-3683  fax: (952) 937-2374&lt;BR /&gt;
&amp;gt; &amp;gt; email: sanders.tec@netzero.com&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; -- NOTE NEW EMAIL ADDRESS --&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/SANDERS.TECH&gt;&lt;/KENT&gt;</description>
      <pubDate>Thu, 28 Aug 2003 09:29:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760043#M169146</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-08-28T09:29:29Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760044#M169147</link>
      <description>oPCompRef.Enabled - produces a runtime error 438 - Object doesn't support&lt;BR /&gt;
property or method.&lt;BR /&gt;
&lt;BR /&gt;
My quesion is, what if there are three identical parts and only two are&lt;BR /&gt;
enabled?  Can the count work differently?  If not, I can deal with it, but&lt;BR /&gt;
what exactly is missing from your if statement below?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your response!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Kent Keller" &lt;KENT&gt; wrote in message&lt;BR /&gt;
news:BDB8F35A0F117F4202EBE876A5D12228@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; If I understand correctly it should just be something like this&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     For Each oPCompRef In oPCompRefs&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;         PartNo = Left((oPCompRef.ReferencedFileDescriptor.DisplayName),&lt;BR /&gt;
&amp;gt; &amp;gt; Len(oPCompRef.ReferencedFileDescriptor.DisplayName) - 4)&lt;BR /&gt;
&amp;gt;         if oPCompRef.Enabled = True then&lt;BR /&gt;
&amp;gt; &amp;gt;         QTY = oPCompRef.ImmediateOccurrences.Count&lt;BR /&gt;
&amp;gt;         end if&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Kent&lt;BR /&gt;
&amp;gt; Assistant Moderator&lt;BR /&gt;
&amp;gt; Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Stephen Anderson" &lt;SANDERS.TECH&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:45822FE41694A75528C8C449DDCA30DE@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; I have an assembly where I count parts and place them in a database.&lt;BR /&gt;
&amp;gt; &amp;gt; Currently, I am counting all parts (by name).  I would like to exclude&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; &amp;gt; parts where the snabled feature is turned off in the specific assembly.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     For Each oPCompRef In oPCompRefs&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;         PartNo = Left((oPCompRef.ReferencedFileDescriptor.DisplayName),&lt;BR /&gt;
&amp;gt; &amp;gt; Len(oPCompRef.ReferencedFileDescriptor.DisplayName) - 4)&lt;BR /&gt;
&amp;gt; &amp;gt;         QTY = oPCompRef.ImmediateOccurrences.Count&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; I am thinking possibly, that changing the QTY variable to ount&lt;BR /&gt;
differently&lt;BR /&gt;
&amp;gt; &amp;gt; might be a viable solution.  On the other hand, perhaps there is another&lt;BR /&gt;
if&lt;BR /&gt;
&amp;gt; &amp;gt; agrument that must be added???&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Thanks in advance for your help!&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;           Steve Anderson&lt;BR /&gt;
&amp;gt; &amp;gt;           Engineer / Documentation Coordinator       _&lt;BR /&gt;
&amp;gt; &amp;gt; METRO MACHINE &amp;amp; ENGINEERING CORP.&lt;BR /&gt;
&amp;gt; &amp;gt; vmail: (952) 259-3683  fax: (952) 937-2374&lt;BR /&gt;
&amp;gt; &amp;gt; email: sanders.tec@netzero.com&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; -- NOTE NEW EMAIL ADDRESS --&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/SANDERS.TECH&gt;&lt;/KENT&gt;</description>
      <pubDate>Thu, 28 Aug 2003 09:49:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760044#M169147</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-08-28T09:49:48Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760045#M169148</link>
      <description>What version are you on?  In R6 and earlier help there was a really nice little example of&lt;BR /&gt;
iterating through subs and counting.   I don't have it here, and don't have time to&lt;BR /&gt;
recreate it, but I could post a copy tonight if no one else does.&lt;BR /&gt;
&lt;BR /&gt;
It has two subs, one that does all the top level components, and the second one iterates&lt;BR /&gt;
through all the subs components.    In this second one you should be able to skip the&lt;BR /&gt;
count simply by checking if the component is enabled or not and using that to decide if&lt;BR /&gt;
you wanted it added to the count or not.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Kent&lt;BR /&gt;
Assistant Moderator&lt;BR /&gt;
Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Stephen Anderson" &lt;SANDERS.TECH&gt; wrote in message&lt;BR /&gt;
news:DBBB12277B7E0E3C20925B8AC081BD5F@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; oPCompRef.Enabled - produces a runtime error 438 - Object doesn't support&lt;BR /&gt;
&amp;gt; property or method.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; My quesion is, what if there are three identical parts and only two are&lt;BR /&gt;
&amp;gt; enabled?  Can the count work differently?  If not, I can deal with it, but&lt;BR /&gt;
&amp;gt; what exactly is missing from your if statement below?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks for your response!&lt;/SANDERS.TECH&gt;</description>
      <pubDate>Thu, 28 Aug 2003 12:08:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760045#M169148</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-08-28T12:08:45Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760046#M169149</link>
      <description>Actually Kent go ahead and post it.  I'm going to need something close to it&lt;BR /&gt;
in a  few week for a work project.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Sean Dotson, PE&lt;BR /&gt;
http://www.sdotson.com&lt;BR /&gt;
Check the Inventor FAQ for most common questions&lt;BR /&gt;
www.sdotson.com/faq.html&lt;BR /&gt;
-----------------------------------------------------------------------&lt;BR /&gt;
"Kent Keller" &lt;KENT&gt; wrote in message&lt;BR /&gt;
news:9756EE21134BE540FEEA905780A9AC03@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; What version are you on?  In R6 and earlier help there was a really nice&lt;BR /&gt;
little example of&lt;BR /&gt;
&amp;gt; iterating through subs and counting.   I don't have it here, and don't&lt;BR /&gt;
have time to&lt;BR /&gt;
&amp;gt; recreate it, but I could post a copy tonight if no one else does.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; It has two subs, one that does all the top level components, and the&lt;BR /&gt;
second one iterates&lt;BR /&gt;
&amp;gt; through all the subs components.    In this second one you should be able&lt;BR /&gt;
to skip the&lt;BR /&gt;
&amp;gt; count simply by checking if the component is enabled or not and using that&lt;BR /&gt;
to decide if&lt;BR /&gt;
&amp;gt; you wanted it added to the count or not.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Kent&lt;BR /&gt;
&amp;gt; Assistant Moderator&lt;BR /&gt;
&amp;gt; Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Stephen Anderson" &lt;SANDERS.TECH&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:DBBB12277B7E0E3C20925B8AC081BD5F@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; oPCompRef.Enabled - produces a runtime error 438 - Object doesn't&lt;BR /&gt;
support&lt;BR /&gt;
&amp;gt; &amp;gt; property or method.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; My quesion is, what if there are three identical parts and only two are&lt;BR /&gt;
&amp;gt; &amp;gt; enabled?  Can the count work differently?  If not, I can deal with it,&lt;BR /&gt;
but&lt;BR /&gt;
&amp;gt; &amp;gt; what exactly is missing from your if statement below?&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Thanks for your response!&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/SANDERS.TECH&gt;&lt;/KENT&gt;</description>
      <pubDate>Thu, 28 Aug 2003 13:30:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760046#M169149</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-08-28T13:30:51Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760047#M169150</link>
      <description>Neither of these work, nor your example of oPCompRef.Enabled.  Any other&lt;BR /&gt;
ideas?&lt;BR /&gt;
&lt;BR /&gt;
oPCompRef.ReferencedDefinition.Occurrences.Item.Enabled&lt;BR /&gt;
&lt;BR /&gt;
oPCompRef.ImmediateOccurrences.Item.Enabled&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help on this!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Kent Keller" &lt;KENT&gt; wrote in message&lt;BR /&gt;
news:BDB8F35A0F117F4202EBE876A5D12228@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; If I understand correctly it should just be something like this&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     For Each oPCompRef In oPCompRefs&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;         PartNo = Left((oPCompRef.ReferencedFileDescriptor.DisplayName),&lt;BR /&gt;
&amp;gt; &amp;gt; Len(oPCompRef.ReferencedFileDescriptor.DisplayName) - 4)&lt;BR /&gt;
&amp;gt;         if oPCompRef.Enabled = True then&lt;BR /&gt;
&amp;gt; &amp;gt;         QTY = oPCompRef.ImmediateOccurrences.Count&lt;BR /&gt;
&amp;gt;         end if&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Kent&lt;BR /&gt;
&amp;gt; Assistant Moderator&lt;BR /&gt;
&amp;gt; Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Stephen Anderson" &lt;SANDERS.TECH&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:45822FE41694A75528C8C449DDCA30DE@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; I have an assembly where I count parts and place them in a database.&lt;BR /&gt;
&amp;gt; &amp;gt; Currently, I am counting all parts (by name).  I would like to exclude&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; &amp;gt; parts where the snabled feature is turned off in the specific assembly.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     For Each oPCompRef In oPCompRefs&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;         PartNo = Left((oPCompRef.ReferencedFileDescriptor.DisplayName),&lt;BR /&gt;
&amp;gt; &amp;gt; Len(oPCompRef.ReferencedFileDescriptor.DisplayName) - 4)&lt;BR /&gt;
&amp;gt; &amp;gt;         QTY = oPCompRef.ImmediateOccurrences.Count&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; I am thinking possibly, that changing the QTY variable to ount&lt;BR /&gt;
differently&lt;BR /&gt;
&amp;gt; &amp;gt; might be a viable solution.  On the other hand, perhaps there is another&lt;BR /&gt;
if&lt;BR /&gt;
&amp;gt; &amp;gt; agrument that must be added???&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Thanks in advance for your help!&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;           Steve Anderson&lt;BR /&gt;
&amp;gt; &amp;gt;           Engineer / Documentation Coordinator       _&lt;BR /&gt;
&amp;gt; &amp;gt; METRO MACHINE &amp;amp; ENGINEERING CORP.&lt;BR /&gt;
&amp;gt; &amp;gt; vmail: (952) 259-3683  fax: (952) 937-2374&lt;BR /&gt;
&amp;gt; &amp;gt; email: sanders.tec@netzero.com&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; -- NOTE NEW EMAIL ADDRESS --&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/SANDERS.TECH&gt;&lt;/KENT&gt;</description>
      <pubDate>Mon, 24 Nov 2003 13:11:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/differentiate-enabled-vs-disabled-parts-in-assembly-using-vba/m-p/760047#M169150</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-11-24T13:11:52Z</dc:date>
    </item>
  </channel>
</rss>

