<?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 a script on parts in assembly in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-a-script-on-parts-in-assembly/m-p/9090691#M102205</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2976138"&gt;@jonatan.holmgren&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try something like this example, which sets the part number of each selected occurrence to be 777, note that this example might error out if a browser node that was not an occurence was selected, such as an assembly level work plane, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

Dim oSelection As SelectSet
oSelection = ThisApplication.ActiveDocument.SelectSet

Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oSelection
	iProperties.Value(oOccurrence.Name, "Project", "Part Number") = "777"
Next&lt;/PRE&gt;</description>
    <pubDate>Wed, 16 Oct 2019 19:18:10 GMT</pubDate>
    <dc:creator>Curtis_Waguespack</dc:creator>
    <dc:date>2019-10-16T19:18:10Z</dc:date>
    <item>
      <title>Running a script on parts in assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-a-script-on-parts-in-assembly/m-p/9090440#M102202</link>
      <description>&lt;P&gt;Trying to solve a problem, not sure it is possible tho.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a script that works well, and does what it's suppose to do.&lt;/P&gt;&lt;P&gt;But in order for it to work I need to open up each part and run it, which is rather taxing.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I would like to be able to select part in the model tree in the assembly and run my script, I know how to make a script to go through each part in the assembly and run it, but it wont work in this case, as I might only want to run it on say 30 out of 70 parts.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 17:11:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-a-script-on-parts-in-assembly/m-p/9090440#M102202</guid>
      <dc:creator>jonatan.holmgren</dc:creator>
      <dc:date>2019-10-16T17:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Running a script on parts in assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-a-script-on-parts-in-assembly/m-p/9090691#M102205</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2976138"&gt;@jonatan.holmgren&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try something like this example, which sets the part number of each selected occurrence to be 777, note that this example might error out if a browser node that was not an occurence was selected, such as an assembly level work plane, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

Dim oSelection As SelectSet
oSelection = ThisApplication.ActiveDocument.SelectSet

Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oSelection
	iProperties.Value(oOccurrence.Name, "Project", "Part Number") = "777"
Next&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Oct 2019 19:18:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/running-a-script-on-parts-in-assembly/m-p/9090691#M102205</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2019-10-16T19:18:10Z</dc:date>
    </item>
  </channel>
</rss>

