<?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: Loop through Assembly for iProperties in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5774462#M116317</link>
    <description>Are you planning on having it batch extract for all view reps or are you&lt;BR /&gt;fine doing 1 view rep at a time/ as required?</description>
    <pubDate>Mon, 17 Aug 2015 17:43:19 GMT</pubDate>
    <dc:creator>MechMachineMan</dc:creator>
    <dc:date>2015-08-17T17:43:19Z</dc:date>
    <item>
      <title>Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5763543#M116310</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to loop through an assembly and get iProperties for each part. The iProperties i need are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Part number&lt;/P&gt;&lt;P&gt;Weld Material&lt;/P&gt;&lt;P&gt;Material&lt;/P&gt;&lt;P&gt;Mass&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can i do this? I can loop through the assembly but im struggling to get all of the properties. I can only seem to get the Mass..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nigel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 07:56:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5763543#M116310</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2015-08-10T07:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5763623#M116311</link>
      <description>&lt;P&gt;Here&amp;nbsp; something&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; For Each oCompOcc As ComponentOccurrence In oLeafOccs

                Select Case oCompOcc.DefinitionDocumentType
                    Case DocumentTypeEnum.kPartDocumentObject
                        Dim objPartDocument As PartDocument = TryCast(oCompOcc.Definition.Document, PartDocument)
                        'Design Tracking Properties, {32853F0F-3444-11D1-9E93-0060B03C1CA6}
                        Dim iProperties As PropertySet = objPartDocument.PropertySets.Item("Design Tracking Properties")
                        MessageBox.Show(iProperties.Item("Part Number").Value)
                        MessageBox.Show(iProperties.Item("Material").Value)
                        MessageBox.Show(iProperties.Item("Weld Material").Value)
                End Select

            Next&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Aug 2015 09:00:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5763623#M116311</guid>
      <dc:creator>humbertogo</dc:creator>
      <dc:date>2015-08-10T09:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5763997#M116312</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the code sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;will this take into account parts in sub assemblies too?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 13:34:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5763997#M116312</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2015-08-10T13:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5764952#M116313</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;are you using the ComponentOccurrenceEnumerator? im having a hard time to get it working right. Any chance you can put the full code in please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 21:14:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5764952#M116313</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2015-08-10T21:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5765428#M116314</link>
      <description>&lt;P&gt;Yes i using ComponentOccurrenceEnumerator&lt;BR /&gt;&lt;BR /&gt;below the full code&lt;/P&gt;&lt;PRE&gt;        Public Sub GetDocumentType(ByRef oAssemblyDoc As AssemblyDocument)
            Dim ComponentOccsEnum As ComponentOccurrencesEnumerator = Nothing
            Dim oAsmDef As AssemblyComponentDefinition =  oAssemblyDoc.ComponentDefinition
            Dim oLeafOccs As ComponentOccurrencesEnumerator = oAsmDef.Occurrences.AllLeafOccurrences
            For Each oCompOcc As ComponentOccurrence In oLeafOccs

                Select Case oCompOcc.DefinitionDocumentType
                    Case DocumentTypeEnum.kPartDocumentObject
                        Dim objPartDocument As PartDocument = TryCast(oCompOcc.Definition.Document, PartDocument)
                        'Design Tracking Properties, {32853F0F-3444-11D1-9E93-0060B03C1CA6}
                        Dim iProperties As PropertySet = objPartDocument.PropertySets.Item("Design Tracking Properties")
                        MessageBox.Show(iProperties.Item("Part Number").Value)
                        MessageBox.Show(iProperties.Item("Material").Value)
                        MessageBox.Show(iProperties.Item("Weld Material").Value)
                End Select

            Next
        End Sub&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Aug 2015 07:49:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5765428#M116314</guid>
      <dc:creator>humbertogo</dc:creator>
      <dc:date>2015-08-11T07:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5773962#M116315</link>
      <description>&lt;P&gt;This workflow is interesting. It could all also have been accomplished by:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Open GA&lt;/P&gt;&lt;P&gt;2. Open BOM&lt;/P&gt;&lt;P&gt;3. Set BOM to Structured - ALL levels&lt;/P&gt;&lt;P&gt;4. Expose necessary iProperties if not already exposed&lt;/P&gt;&lt;P&gt;5. Export BOM to excel&lt;/P&gt;&lt;P&gt;6. Open BOM in excel and delete columns that are not needed.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2015 13:32:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5773962#M116315</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2015-08-17T13:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5774435#M116316</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes but thats a ridiculously long and manual method. Originally, i started like that but then had a need to get the list into a data table. I looped through the assembly and collected the bom however, the bom does not consider design view reps. If the assembly has a few alternate view reps with parts visiblity turned off in those reps, i get an incorrect bom for that particular view rep. So i moved away from the bom and am looking for an alternate method&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2015 17:33:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5774435#M116316</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2015-08-17T17:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5774462#M116317</link>
      <description>Are you planning on having it batch extract for all view reps or are you&lt;BR /&gt;fine doing 1 view rep at a time/ as required?</description>
      <pubDate>Mon, 17 Aug 2015 17:43:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5774462#M116317</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2015-08-17T17:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5774468#M116318</link>
      <description>Im fine doing just one view rep at a time &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;Its only the active view rep i need, i have a switch to select different view reps incase its not the &amp;nbsp;correct rep. My current method however, doesnt provide a qty list. I have to use linq at the end and it takes ages...&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 17 Aug 2015 17:47:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5774468#M116318</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2015-08-17T17:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5774553#M116319</link>
      <description>&lt;P&gt;Yeahhhhh... Trying to get quantity of an assembly and exclude invisible/suppressed parts is tough. Inventor really doesn't seem to like that workflow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you thought about using multiple similiar sub-assemblies; except instead of making parts invisible/suppressed you make a new assembly document which has them deleted?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This would also go along easy with drawings as the parts have the same internal name. You would just have to replace model reference in the drawings were you to want to use a different "view rep".&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2015 18:26:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5774553#M116319</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2015-08-17T18:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5774606#M116320</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dont know if that would work or not. The assemblies are already done and we have a catalog that goes back a long way. We use view reps alot as they are quick and easy to show different permutations of a fixture assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do have a working routine for bom items to be listed based on their visibility but its like a multi loop and takes a long time. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for each item in bom, loop assembly, find it and xheck its visibility.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this means, for every bom item iteration, there is an assembly loop. So, 100 bom items becomes 100 assembly loops instead of just one loop. I couldnt find a method of looping through a bom and for each item, checking its visibility. I tried component definitions and occurrences but nothing worked&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cherrs&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2015 18:41:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/5774606#M116320</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2015-08-17T18:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/6071308#M116321</link>
      <description>&lt;P&gt;Referring back to the original post on this thread, I would like to do something similar, but using &lt;STRONG&gt;AllReferencedDocuments&lt;/STRONG&gt; instead of &lt;STRONG&gt;ComponentOccurance&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a sample in this &lt;A href="http://inventbetter.blogspot.ca/2014/03/an-iprop-for-unique-items.html" target="_self"&gt;blog&lt;/A&gt;, but it doesn't provide the code to loop through any sub-assemblies should they be found.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone help me out with the code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 22:22:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/6071308#M116321</guid>
      <dc:creator>jlane</dc:creator>
      <dc:date>2016-03-04T22:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/6071311#M116322</link>
      <description>For each oDoc as Document in&lt;BR /&gt;ThisApplication.ActiveDocument.AllReferencedDocuments&lt;BR /&gt;'Do something with oDoc here&lt;BR /&gt;Next</description>
      <pubDate>Fri, 04 Mar 2016 22:25:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/6071311#M116322</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2016-03-04T22:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/6071318#M116323</link>
      <description>&lt;P&gt;Hi MechMachineMan, thx for your quick reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, that's what exactly what I have.&amp;nbsp; I have it successfully looping through each referenced document in the active assembly, and it works very well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I get it to iterate though any sub-assemblies when they are encountered?&amp;nbsp; (Sorry if I wasn't clear on that, my bad)&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 22:33:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/6071318#M116323</guid>
      <dc:creator>jlane</dc:creator>
      <dc:date>2016-03-04T22:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/6071340#M116324</link>
      <description>It goes through each loaded document thats referenced by the primary&lt;BR /&gt;assembly only once, and thus will loop through sub-assembly parts in an&lt;BR /&gt;unpredictable order. You will need to test the parts to find what criteria&lt;BR /&gt;it needs to meet in order for it to have your changes implemented.</description>
      <pubDate>Fri, 04 Mar 2016 22:49:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/6071340#M116324</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2016-03-04T22:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/6202421#M116325</link>
      <description>&lt;P&gt;Excellent, thx for that clarification!&amp;nbsp; I'm new to this and still becoming familiar with the behaviour.&amp;nbsp; I tried it out and it worked exactly as you described.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 14:18:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/6202421#M116325</guid>
      <dc:creator>jlane</dc:creator>
      <dc:date>2016-03-07T14:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through Assembly for iProperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/6208080#M116326</link>
      <description>&lt;P&gt;Why do you need the BOM to do this? I'm trying to understand what is going on here.. But if i'm correct ( let me know if i'm not ).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You want to export the iProperties for all VISIBLE components in the assembly and sub-assemblies? And count their quantity also based on the visibility?&lt;/P&gt;&lt;P&gt;If this is the case you could do this in 1 inventor loop and 1 internal loop with sub-loop? and not use the BOM?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inventor loop:&lt;/P&gt;&lt;P&gt;You can create an array, store all iProperties on the found occurences &lt;STRONG&gt;IF&lt;/STRONG&gt; &lt;STRONG&gt;visible&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the array is made, you could loop through it. Read the first row it's partnumber. Start a sub-loop counting the matching partnumbers you encounter &lt;STRONG&gt;IF&lt;/STRONG&gt; a partnumber matches you could set it to "0" or nothing in example, just something you can recognize as already counted. If the sub-loop is done you can export the first row it's iProperties to a spreadsheet along with the counted QTY.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now your loop chechs all the next items in the array. If the partnumber returns "0" or nothing in example, you can skip it and do the next because that occurence is already counted in the spreadsheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my humble experience a loop in a self created array always works alot faster then looping in the Inventor occurences. This because you only have data you want in you selfmade array and in Inventor the items are much larger because they hold data you don't need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe i'm missing something why this would not be an solution. Please let me know &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 07:55:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/loop-through-assembly-for-iproperties/m-p/6208080#M116326</guid>
      <dc:creator>Jef_E</dc:creator>
      <dc:date>2016-03-10T07:55:12Z</dc:date>
    </item>
  </channel>
</rss>

