<?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: Send parameters to specific assemblies in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8997593#M72241</link>
    <description>&lt;P&gt;It bloody works!!!&lt;/P&gt;&lt;P&gt;Thank you so much.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wish I knew how to do it myself like...&lt;/P&gt;</description>
    <pubDate>Fri, 30 Aug 2019 12:13:21 GMT</pubDate>
    <dc:creator>SharkDesign</dc:creator>
    <dc:date>2019-08-30T12:13:21Z</dc:date>
    <item>
      <title>Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8987711#M72226</link>
      <description>&lt;P&gt;I'm using the following code which sends certain parameters down to every part.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My main assembly is made up of 4 separate assemblies and I don't need to send all parameters to each assembly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance, some will go to all parts in asm 1, and different ones need to go to all parts in asm 2 etc.&lt;/P&gt;&lt;P&gt;Is there a way to specify which assemblies to send it to rather than sending it to absolutely everything.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This just takes ages and thought it would streamline the process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub Main()
Dim oAsmDoc As AssemblyDocument 
oAsmDoc = ThisApplication.ActiveDocument  
Call Iterate(oAsmDoc.ComponentDefinition.Occurrences, 1)
End Sub 

Private Sub Iterate(Occurrences As ComponentOccurrences, Level As Integer) 
'Iterate through Assembly

Dim oOcc As ComponentOccurrence 
For Each oOcc In Occurrences 

'Find Parts in Assembly
Dim Part As String
Part = oOcc.Name

On Error Resume Next
Parameter(Part, "XXX") = XXX &lt;BR /&gt;Parameter(Part, "yyy") = yyy
etc
etc
etc

'Run through the sub assemblies 
If oOcc.DefinitionDocumentType = kAssemblyDocumentObject Then
Call Iterate(oOcc.SubOccurrences, Level + 1) 
End If 
Next 

InventorVb.DocumentUpdate()
End Sub&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Aug 2019 13:56:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8987711#M72226</guid>
      <dc:creator>SharkDesign</dc:creator>
      <dc:date>2019-08-26T13:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8988625#M72227</link>
      <description>&lt;P&gt;If you loop through, "allReferencedDocument" instead of all the occurences it would speed up your time alot, and then you may get a way with sending all the parameters but:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you know which parts/assemblies will get what parameters?&lt;/P&gt;&lt;P&gt;You can set an iProperty on those assemblies that will determine if parameters are sent.&lt;/P&gt;&lt;P&gt;and then instead of looping through all occurrences, you can have two loops:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;one that checks the assembly for the iproperty indicating to set the parameters.&lt;/P&gt;&lt;P&gt;and then you loop through this assembly to set the parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Main&lt;/SPAN&gt;()
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oasmDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oasmDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisAssembly&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;tempDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oasmDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllReferencedDocuments&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;tempDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kAssemblyDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;	
	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;strFlag&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt;
	
	&lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;		
		&lt;SPAN style="color: #800000;"&gt;strFlag&lt;/SPAN&gt;= &lt;SPAN style="color: #800080;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;tempDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DisplayName&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"propertyFlag"&lt;/SPAN&gt;)
	&lt;SPAN style="color: #ff0000;"&gt;Catch&lt;/SPAN&gt;
		&lt;SPAN style="color: #800000;"&gt;strFlag&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;		
	
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;strFlag&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Iterate&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;tempDoc&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;strFlag&lt;/SPAN&gt;)
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;		
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;	
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt;

	
&lt;SPAN style="color: #ff0000;"&gt;Private&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Iterate&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyDocument&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;flag&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;) 
	
	&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;td&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllReferencedDocuments&lt;/SPAN&gt;
									
		&lt;SPAN style="color: #ff0000;"&gt;Select&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Case&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;flag&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Case&lt;/SPAN&gt; &lt;SPAN style="color: #008080;"&gt;"x"&lt;/SPAN&gt;		
				&lt;SPAN style="color: #808080;"&gt;'On Error Resume Next 'or &lt;/SPAN&gt;
				&lt;SPAN style="color: #808080;"&gt;'create the parameter? ...	&lt;/SPAN&gt;
				&lt;SPAN style="color: #800080;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;tempDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DisplayName&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"XXX"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;XXX&lt;/SPAN&gt;
				&lt;SPAN style="color: #808080;"&gt;'.&lt;/SPAN&gt;
				&lt;SPAN style="color: #808080;"&gt;'.						&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Case&lt;/SPAN&gt; &lt;SPAN style="color: #008080;"&gt;"y"&lt;/SPAN&gt;				
				&lt;SPAN style="color: #800080;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;tempDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DisplayName&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"yyy"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;yyy&lt;/SPAN&gt;
				&lt;SPAN style="color: #808080;"&gt;'.					&lt;/SPAN&gt;
				&lt;SPAN style="color: #808080;"&gt;'.&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Select&lt;/SPAN&gt;	
	&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
	
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 21:40:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8988625#M72227</guid>
      <dc:creator>omartin</dc:creator>
      <dc:date>2019-08-26T21:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8989045#M72228</link>
      <description>I have 4 assemblies, bay 1 2 3 4&lt;BR /&gt;Parameters that start with bay 2 would go to bay 3 parameters starting with&lt;BR /&gt;bay 4 would go to that assembly.&lt;BR /&gt;Basically.you have the option to set the width of each bay and so the&lt;BR /&gt;parameters drive the length of parts in each bay.&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Aug 2019 04:55:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8989045#M72228</guid>
      <dc:creator>SharkDesign</dc:creator>
      <dc:date>2019-08-27T04:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8989382#M72229</link>
      <description>&lt;P&gt;I meant marked Bay 2 would go to bay2, but it won't let me edit the post.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 08:16:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8989382#M72229</guid>
      <dc:creator>SharkDesign</dc:creator>
      <dc:date>2019-08-27T08:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8989471#M72230</link>
      <description>&lt;P&gt;Can't get this to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I replaced TD with tempdoc which seemed to fix it, but it doesn't write any parameters at all.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm assuming&amp;nbsp;propertyFlag is the name of my custom property&lt;/P&gt;&lt;PRE&gt;strFlag= iProperties.Value(tempDoc.DisplayName, "Custom", "propertyFlag")&lt;/PRE&gt;&lt;P&gt;and&amp;nbsp; "x" is the property text inserted in the property flag iproperty.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Case "x"&lt;/PRE&gt;&lt;P&gt;Also, does&amp;nbsp;propertyFlag have to be in the iproperties of every part or just the ones I want to send the parameter to?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 09:03:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8989471#M72230</guid>
      <dc:creator>SharkDesign</dc:creator>
      <dc:date>2019-08-27T09:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8989485#M72231</link>
      <description>&lt;P&gt;I'm also interested in how to modify the original code to cycle through referenced documents instead of every single part as I have used similar code elsewhere and this could speed it up.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 09:17:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8989485#M72231</guid>
      <dc:creator>SharkDesign</dc:creator>
      <dc:date>2019-08-27T09:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8990613#M72232</link>
      <description>&lt;P&gt;Yes your right the 'propertyFlag' was just an iProperty I came up with, you would need to add this iProeprty to just the assembly, you want to push paramaters down from and the x would indicate which paramter set your are dealing with, you could change this to 'bay 1, 2 etc".&amp;nbsp; so for the 'bay 2' sub assembly you would add the 'propertyFlag' iproperty and it should send the parameters to everything under this sub assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But that was before I knew how you were deciding to send the parameters:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can try with:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Class&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;rule&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oasmDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyDocument&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Main&lt;/SPAN&gt;()
&lt;SPAN style="color: #808080;"&gt;'Dim oasmDoc As AssemblyDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oasmDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;ThisAssembly&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;tempDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oasmDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllReferencedDocuments&lt;/SPAN&gt;		
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;tempDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kAssemblyDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;	
		&lt;SPAN style="color: #808080;"&gt;'you can add some more logic here to refine your search&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Iterate&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;tempDoc&lt;/SPAN&gt;)	
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;	
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt;


&lt;SPAN style="color: #ff0000;"&gt;Private&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Iterate&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyDocument&lt;/SPAN&gt;) 
	
	&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;tempDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllReferencedDocuments&lt;/SPAN&gt;						
	
	&lt;SPAN style="color: #ff0000;"&gt;On&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Error&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Resume&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt; &lt;SPAN style="color: #808080;"&gt;'or creta parameter?&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Select&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Case&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;			
			&lt;SPAN style="color: #ff0000;"&gt;Case&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FullDocumentName&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"bay 1"&lt;/SPAN&gt;)		
				
				&lt;SPAN style="color: #808080;"&gt;'create the parameter? ...	&lt;/SPAN&gt;
				
				&lt;SPAN style="color: #800000;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;tempDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DisplayName&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"xxx"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oasmDoc&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"xxx"&lt;/SPAN&gt;)				
				&lt;SPAN style="color: #808080;"&gt;'.&lt;/SPAN&gt;
				&lt;SPAN style="color: #808080;"&gt;'.						&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Case&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FullDocumentName&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"bay 2"&lt;/SPAN&gt;)						
				&lt;SPAN style="color: #808080;"&gt;'Parameter(tempDoc.DisplayName, "yyy") = 45&lt;/SPAN&gt;
				&lt;SPAN style="color: #800000;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;tempDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DisplayName&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"yyy"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oasmDoc&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"yyy"&lt;/SPAN&gt;)
				&lt;SPAN style="color: #808080;"&gt;'.					&lt;/SPAN&gt;
				&lt;SPAN style="color: #808080;"&gt;'.&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Select&lt;/SPAN&gt;	
	&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
	
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Class&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;The prob with the original code I don't see any checks to know which parameter sets need to be passed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;instead of passing all the occurrences you would pass allReferncedDocuments.&lt;/P&gt;&lt;P&gt;and then in your sub routine. you would need to check the parts parent assembly to see what bay it is (if you have multiple subs you would have to loop up the tree).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then you wouldn't need the last bit where you had loop though sub assemblies because you already checked each individual file/part&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 16:54:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8990613#M72232</guid>
      <dc:creator>omartin</dc:creator>
      <dc:date>2019-08-27T16:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8991964#M72233</link>
      <description>&lt;P&gt;I get loads of errors&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public oasmDoc As AssemblyDocument&lt;/PRE&gt;&lt;P&gt;Type AssemblyDocument is not defined&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;For Each tempDoc As Document In oasmDoc.AllReferencedDocuments&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #666666; cursor: text; font-family: inherit; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.7142; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;'ThisAssembly' is not accessible in this context because it is a 'Friend' (no idea what that means but I thought it was amusing)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;oasmDoc = ThisAssembly.Document&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Type 'Documnet' is not defined.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Private Sub Iterate(Occurrences As AssemblyDocument) &lt;/PRE&gt;&lt;P&gt;Type AssemblyDocument is not defined&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;For Each tempDoc As Document In Occurrences.AllReferencedDocuments&lt;/PRE&gt;&lt;P&gt;Type 'Document' is not defined&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 07:18:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8991964#M72233</guid>
      <dc:creator>SharkDesign</dc:creator>
      <dc:date>2019-08-28T07:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8993252#M72234</link>
      <description>&lt;P&gt;I made oasmDoc a global variable so you have to wrap the whole thing in a class see the first few lines:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Class rule&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Public oasmDoc As AssemblyDocument&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub Main()&lt;BR /&gt;&lt;FONT color="#808080"&gt;'Dim oasmDoc As AssemblyDocument&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;oasmDoc = ThisAssembly.Document&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;Also I found using the display name for setting the parameter is not that consistent you can change:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;Parameter(tempDoc.DisplayName, "XXX") ...&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;to:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;Dim filename As String = IO.Path.GetFileName(oOcc.FullDocumentName)&lt;BR /&gt;Parameter(filename, "xxx")...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;Also I was thinking about it, you could still use you original code, if you simply want to send all the parameters, without checking what bay it is in:&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Main&lt;/SPAN&gt;()
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsmDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyDocument&lt;/SPAN&gt; 
&lt;SPAN style="color: #800000;"&gt;oAsmDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;  
&lt;SPAN style="color: #ff0000;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Iterate&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oAsmDoc&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; 

&lt;SPAN style="color: #ff0000;"&gt;Private&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Iterate&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyDocument&lt;/SPAN&gt;)&lt;SPAN style="color: #808080;"&gt;', Level As Integer) &lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'Iterate through Assembly&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; 
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;allReferencedDocuments&lt;/SPAN&gt; 
&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'Find Parts in Assembly&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'Dim Part As String&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'Part = oOcc.Name&lt;/SPAN&gt;

	&lt;SPAN style="color: #ff0000;"&gt;On&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Error&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Resume&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;

	&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;filename&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Path&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetFileName&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FullDocumentName&lt;/SPAN&gt;)	
	
	&lt;SPAN style="color: #808080;"&gt;'Parameter(Occurrences,"xxx") these are the parameters from your top assembly&lt;/SPAN&gt;
	&lt;SPAN style="color: #800080;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;filename&lt;/SPAN&gt;,&lt;SPAN style="color: #008080;"&gt;"xxx"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800080;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt;,&lt;SPAN style="color: #008080;"&gt;"xxx"&lt;/SPAN&gt;) 
	&lt;SPAN style="color: #800080;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;filename&lt;/SPAN&gt;,&lt;SPAN style="color: #008080;"&gt;"yyy"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800080;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt;,&lt;SPAN style="color: #008080;"&gt;"yyy"&lt;/SPAN&gt;) 

&lt;SPAN style="color: #808080;"&gt;''Run through the sub assemblies &lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'If oOcc.DefinitionDocumentType = kAssemblyDocumentObject Then&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'Call Iterate(oOcc.SubOccurrences, Level + 1) &lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'End If &lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt; 

&lt;SPAN style="color: #800080;"&gt;InventorVb&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;DocumentUpdate&lt;/SPAN&gt;()
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 15:51:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8993252#M72234</guid>
      <dc:creator>omartin</dc:creator>
      <dc:date>2019-08-28T15:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8993261#M72235</link>
      <description>Yeh I copied the global bit.&lt;BR /&gt;When it didn't work I just copied your entire code in and it didn't like&lt;BR /&gt;it.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Aug 2019 15:54:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8993261#M72235</guid>
      <dc:creator>SharkDesign</dc:creator>
      <dc:date>2019-08-28T15:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8993278#M72236</link>
      <description>&lt;P&gt;hmmm you can try to declare it as inventor.assemblydocument&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 15:58:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8993278#M72236</guid>
      <dc:creator>omartin</dc:creator>
      <dc:date>2019-08-28T15:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8993983#M72237</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;maby this code helps. it creates a dictonary of all parameters in the main assembly. then it creates a list with all the &lt;STRONG&gt;unique&lt;/STRONG&gt; part files. it loops over that list and opens all part documents. In those documents for each parameter is checked if that parameter is also avalible in the&amp;nbsp; dictonary (of parameters in the main assembly) if that is true then the value/expresion is copyed to the part files parameter.&lt;/P&gt;&lt;P&gt;conclusion:&lt;/P&gt;&lt;P&gt;parts will only be checked 1 time for parameters that are both in the main assembly and in the subassemblys. only thos parameters are copyed.&lt;/P&gt;&lt;PRE&gt;Sub Main()
    Dim doc As AssemblyDocument = ThisApplication.ActiveDocument

    Dim mainParameterList As Dictionary(Of String, UserParameter) = New Dictionary(Of String, UserParameter)()
    For Each Parameter As UserParameter In doc.ComponentDefinition.Parameters.UserParameters
        mainParameterList.Add(Parameter.Name, Parameter)
    Next
	
	Dim FileNameList As List(Of String) = createPartsList(doc)
    For Each fullFileName As String In FileNameList

        Dim pDoc As PartDocument = ThisApplication.Documents.Open(fullFileName, False)
        For Each Parameter As UserParameter In pDoc.ComponentDefinition.Parameters.UserParameters
            If (mainParameterList.ContainsKey(Parameter.Name)) Then
                Parameter.Expression = mainParameterList(Parameter.Name).Expression
                MsgBox(String.Format("Parameter '{0}' is updated to '{1}' in document: {2}",
                                     Parameter.Name,
                                     Parameter.Expression,
                                     pDoc.DisplayName))
            End If
        Next
        pDoc.Close(True)
    Next
End Sub

Function createPartsList(doc As AssemblyDocument) As List(Of String)
    Dim newList As List(Of String) = New List(Of String)()

    For Each oOcc As Document In doc.ReferencedDocuments ' .ComponentDefinition.Occurrences
        If (oOcc.DocumentType = DocumentTypeEnum.kPartDocumentObject) Then
            Dim fullFileName = oOcc.FullFileName
            If (newList.Contains(fullFileName) = False) Then
                newList.Add(fullFileName)
            End If
        ElseIf (oOcc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject) Then
            For Each fullFileName As String In createPartsList(oOcc)
                If (newList.Contains(fullFileName) = False) Then
                    newList.Add(fullFileName)
                End If
            Next
        End If
    Next
    Return newList
End Function&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 21:52:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8993983#M72237</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2019-08-28T21:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8994546#M72238</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3472477"&gt;@omartin&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;hmmm you can try to declare it as inventor.assemblydocument&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I then get the error&amp;nbsp;"Type 'Inventor.AssemblyDocument' is not defined."&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 07:09:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8994546#M72238</guid>
      <dc:creator>SharkDesign</dc:creator>
      <dc:date>2019-08-29T07:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8994677#M72239</link>
      <description>&lt;P&gt;This seems to work quite well, but it only writes to part files.&lt;/P&gt;&lt;P&gt;Is there a way to push this to the parameters of the sub assembly as well?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 08:03:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8994677#M72239</guid>
      <dc:creator>SharkDesign</dc:creator>
      <dc:date>2019-08-29T08:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8996215#M72240</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;i updated the code. it now also pushes parameters to sub-assemblys.&lt;/P&gt;&lt;PRE&gt;Sub Main()
        Dim doc As AssemblyDocument = ThisDoc.Document

        Dim mainParameterList As Dictionary(Of String, UserParameter) = New Dictionary(Of String, UserParameter)()
        For Each Parameter As UserParameter In doc.ComponentDefinition.Parameters.UserParameters
            mainParameterList.Add(Parameter.Name, Parameter)
        Next

        Dim fileList As List(Of String) = createPartsList(doc)
        For Each fullFileName As String In fileList
            Dim oDoc As Document = ThisApplication.Documents.Open(fullFileName, False)
            Dim docParameters As UserParameters = Nothing
            If (oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject) Then
                Dim pDoc As PartDocument = oDoc
                docParameters = pDoc.ComponentDefinition.Parameters.UserParameters
            ElseIf (oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject) Then
                Dim aDoc As AssemblyDocument = oDoc
                docParameters = aDoc.ComponentDefinition.Parameters.UserParameters
            End If


            For Each Parameter As UserParameter In docParameters
                If (mainParameterList.ContainsKey(Parameter.Name)) Then
                    Parameter.Expression = mainParameterList(Parameter.Name).Expression
                    MsgBox(String.Format("Parameter '{0}' is updated to '{1}' in document: {2}",
                                         Parameter.Name,
                                         Parameter.Expression,
                                         oDoc.DisplayName))
                End If
            Next
            oDoc.Close(True)
        Next
    End Sub

    Function createPartsList(doc As AssemblyDocument) As List(Of String)
        Dim newList As List(Of String) = New List(Of String)()

        For Each oOcc As Document In doc.ReferencedDocuments ' .ComponentDefinition.Occurrences
            Dim fullFileName = oOcc.FullFileName
            If (oOcc.DocumentType = DocumentTypeEnum.kPartDocumentObject) Then
                If (newList.Contains(fullFileName) = False) Then
                    newList.Add(fullFileName)
                End If
            ElseIf (oOcc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject) Then
                For Each FileName As String In createPartsList(oOcc)
                    If (newList.Contains(fullFileName) = False) Then
                        newList.Add(fullFileName)
                    End If
                Next
                If (newList.Contains(fullFileName) = False) Then
                    newList.Add(fullFileName)
                End If
            End If
        Next
        Return newList
    End Function&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Aug 2019 19:04:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8996215#M72240</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2019-08-29T19:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Send parameters to specific assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8997593#M72241</link>
      <description>&lt;P&gt;It bloody works!!!&lt;/P&gt;&lt;P&gt;Thank you so much.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wish I knew how to do it myself like...&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 12:13:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/send-parameters-to-specific-assemblies/m-p/8997593#M72241</guid>
      <dc:creator>SharkDesign</dc:creator>
      <dc:date>2019-08-30T12:13:21Z</dc:date>
    </item>
  </channel>
</rss>

