<?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: Copy user parameters from assembly to parts in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10539535#M47399</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just wanted to say thank you and I know this research and post on your blog is going to help a lot of people.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;People like you who makes life much easier.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Aug 2021 08:02:32 GMT</pubDate>
    <dc:creator>helouise</dc:creator>
    <dc:date>2021-08-12T08:02:32Z</dc:date>
    <item>
      <title>Copy user parameters from assembly to parts</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10513802#M47394</link>
      <description>&lt;P&gt;Good day,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got this code from a Forum that &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5741855"&gt;@BrianEkins&lt;/a&gt; answered to copy all user parameter from assembly to parts in that assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added an event trigger on asm to any user parameter changes so everytime I change something everyting in the parts update as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now with 2022 Model states, as soon as I add a model state to a part it gives an error: Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im starting with iLogic as I have seen it really can do wonders.&lt;/P&gt;&lt;P&gt;Can anyone advise me how to change code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ce5c95;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Main&lt;/SPAN&gt;()
	&lt;SPAN style="color: #db9652;"&gt;CopyUserParams&lt;/SPAN&gt;()
&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt;

&lt;SPAN style="color: #ce5c95;"&gt;Private&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;CopyUserParams&lt;/SPAN&gt;()
    &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #9d6bce;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Document&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DocumentType&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN style="color: #db9652;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kAssemblyDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: #db9652;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"The active document must be an assembly."&lt;/SPAN&gt;)
        &lt;SPAN style="color: #ce5c95;"&gt;Return&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt;

    &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Document&lt;/SPAN&gt;	
    &lt;SPAN style="color: #ce5c95;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;refDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AllReferencedDocuments&lt;/SPAN&gt;
        &lt;SPAN style="color: #b2b2b5;"&gt;' Look for part documents.&lt;/SPAN&gt;
        &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;refDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt;
            &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;refDoc&lt;/SPAN&gt;
            &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;refDocUserParams&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt;

            &lt;SPAN style="color: #b2b2b5;"&gt;' Add the assembly parameters to the part.&lt;/SPAN&gt;
            &lt;SPAN style="color: #ce5c95;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameter&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt;
                &lt;SPAN style="color: #b2b2b5;"&gt;' Check to see if the parameter already exists.&lt;/SPAN&gt;
                &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameter&lt;/SPAN&gt; = &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt;
                &lt;SPAN style="color: #ce5c95;"&gt;Try&lt;/SPAN&gt;
                    &lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;refDocUserParams&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Name&lt;/SPAN&gt;)
                &lt;SPAN style="color: #ce5c95;"&gt;Catch&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ex&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Exception&lt;/SPAN&gt;
                    &lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt; = &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt;
                &lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Try&lt;/SPAN&gt;

                &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt;
                    &lt;SPAN style="color: #b2b2b5;"&gt;' Create the missing parameter.&lt;/SPAN&gt;
                    &lt;SPAN style="color: #db9652;"&gt;refDocUserParams&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AddByExpression&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Expression&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Units&lt;/SPAN&gt;)
                &lt;SPAN style="color: #ce5c95;"&gt;Else&lt;/SPAN&gt;
                    &lt;SPAN style="color: #b2b2b5;"&gt;' Update the value of the existing parameter.&lt;/SPAN&gt;
                    &lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Expression&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Expression&lt;/SPAN&gt;
                &lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt;
            &lt;SPAN style="color: #ce5c95;"&gt;Next&lt;/SPAN&gt;
        &lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 11:31:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10513802#M47394</guid>
      <dc:creator>helouise</dc:creator>
      <dc:date>2021-08-02T11:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Copy user parameters from assembly to parts</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10516528#M47395</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10150147"&gt;@helouise&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's working perfect at my end, try to tick on "Straight VB code"&amp;nbsp; and run again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bhavik4244_0-1627987309595.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/947964i8D8669A1788262B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bhavik4244_0-1627987309595.png" alt="bhavik4244_0-1627987309595.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 10:41:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10516528#M47395</guid>
      <dc:creator>bhavik4244</dc:creator>
      <dc:date>2021-08-03T10:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Copy user parameters from assembly to parts</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10520951#M47396</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #9d6bce;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Document&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DocumentType&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN style="color: #db9652;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kAssemblyDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt;
	&lt;SPAN style="color: #db9652;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"The active document must be an assembly."&lt;/SPAN&gt;)
	&lt;SPAN style="color: #ce5c95;"&gt;Return&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmParams&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;asmDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt;

&lt;SPAN style="color: #ce5c95;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;refDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AllReferencedDocuments&lt;/SPAN&gt;
	&lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;refDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt;		
		&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;refDoc&lt;/SPAN&gt;
		&lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; (&lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ModelStates&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Count&lt;/SPAN&gt; = 1) &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt;
			
			&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;refDocUserParams&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt;
            &lt;SPAN style="color: #ce5c95;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameter&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt;
                &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameter&lt;/SPAN&gt; = &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt;
                &lt;SPAN style="color: #ce5c95;"&gt;Try&lt;/SPAN&gt;
                    &lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;refDocUserParams&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Name&lt;/SPAN&gt;)
                &lt;SPAN style="color: #ce5c95;"&gt;Catch&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ex&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Exception&lt;/SPAN&gt;
                    &lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt; = &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt;
                &lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Try&lt;/SPAN&gt;

                &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt;
                    &lt;SPAN style="color: #db9652;"&gt;refDocUserParams&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AddByExpression&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Expression&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Units&lt;/SPAN&gt;)
                &lt;SPAN style="color: #ce5c95;"&gt;Else&lt;/SPAN&gt;
                    &lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Expression&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Expression&lt;/SPAN&gt;
                &lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt;
            &lt;SPAN style="color: #ce5c95;"&gt;Next&lt;/SPAN&gt;
		&lt;SPAN style="color: #ce5c95;"&gt;Else&lt;/SPAN&gt;
			&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;facDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;FactoryDocument&lt;/SPAN&gt;

			&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;modelStates&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ModelStates&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;facDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ModelStates&lt;/SPAN&gt;
			&lt;SPAN style="color: #ce5c95;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;modelState&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ModelState&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;modelStates&lt;/SPAN&gt;
				&lt;SPAN style="color: #db9652;"&gt;ModelState&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Activate&lt;/SPAN&gt;()

				&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;memberDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;ModelState&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Document&lt;/SPAN&gt;

				&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;memeberParams&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;facDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt;
				&lt;SPAN style="color: #ce5c95;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameter&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmParams&lt;/SPAN&gt;
					&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameter&lt;/SPAN&gt; = &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt;
					&lt;SPAN style="color: #ce5c95;"&gt;Try&lt;/SPAN&gt;
						&lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;memeberParams&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Name&lt;/SPAN&gt;)
					&lt;SPAN style="color: #ce5c95;"&gt;Catch&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ex&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Exception&lt;/SPAN&gt;
						&lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt; = &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt;
					&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Try&lt;/SPAN&gt;

					&lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt;
						&lt;SPAN style="color: #db9652;"&gt;memeberParams&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AddByExpression&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Expression&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Units&lt;/SPAN&gt;)
					&lt;SPAN style="color: #ce5c95;"&gt;Else&lt;/SPAN&gt;
						&lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Expression&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Expression&lt;/SPAN&gt;
					&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt;

				&lt;SPAN style="color: #ce5c95;"&gt;Next&lt;/SPAN&gt;
			&lt;SPAN style="color: #ce5c95;"&gt;Next&lt;/SPAN&gt;
		&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt;
	&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;I need to go now. But I can explain a bit more later if needed. Anyway, &lt;A href="https://forums.autodesk.com/t5/inventor-customization/ilogic-control-parameters-in-model-states/td-p/10221868" target="_blank" rel="noopener"&gt;this&lt;/A&gt; post gave me the correct idea.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 21:43:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10520951#M47396</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2021-08-04T21:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Copy user parameters from assembly to parts</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10524835#M47397</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the reply I ended up using a part in assembly to control parameters from main assembly using following code and a form. (Control being the name of the part were all other parts are linked to)&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #9d6bce;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Control:1"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Length"&lt;/SPAN&gt;) = &lt;SPAN style="color: #5178c8;"&gt;Length&lt;/SPAN&gt;
&lt;SPAN style="color: #9d6bce;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Control:1"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Width"&lt;/SPAN&gt;) = &lt;SPAN style="color: #5178c8;"&gt;Width&lt;/SPAN&gt;
&lt;SPAN style="color: #9d6bce;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Control:1"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"QTY"&lt;/SPAN&gt;) = &lt;SPAN style="color: #5178c8;"&gt;QTY&lt;/SPAN&gt;
&lt;SPAN style="color: #9d6bce;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Control:1"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Dist"&lt;/SPAN&gt;) = &lt;SPAN style="color: #5178c8;"&gt;Dist&lt;/SPAN&gt;
&lt;SPAN style="color: #9d6bce;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Control:1"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Hole_Size"&lt;/SPAN&gt;) = &lt;SPAN style="color: #5178c8;"&gt;Hole_Size&lt;/SPAN&gt;
&lt;SPAN style="color: #9d6bce;"&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Control:1"&lt;/SPAN&gt;, &lt;SPAN style="color: #35b173;"&gt;"Hole_Dist1"&lt;/SPAN&gt;) = &lt;SPAN style="color: #5178c8;"&gt;Hole_Dist1&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ActiveDocument&lt;/SPAN&gt;

&lt;SPAN style="color: #db9652;"&gt;asmDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Update&lt;/SPAN&gt;()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I am Starting new Assembly now and going to try your code. Thank you will let you know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That post is Exactly where I got above code from&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 08:17:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10524835#M47397</guid>
      <dc:creator>helouise</dc:creator>
      <dc:date>2021-08-06T08:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Copy user parameters from assembly to parts</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10527779#M47398</link>
      <description>&lt;P&gt;I found a much cleaner solution. You can find all details and explanations on &lt;A href="http://hjalte.nl/36-update-parameters-and-modelstates" target="_blank" rel="noopener"&gt;my blog&lt;/A&gt;.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ce5c95;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Main&lt;/SPAN&gt;()
	&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #9d6bce;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #9d6bce;"&gt;Document&lt;/SPAN&gt;
	&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmParams&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;asmDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt;

	&lt;SPAN style="color: #ce5c95;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;refDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AllReferencedDocuments&lt;/SPAN&gt;
		&lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;refDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DocumentType&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN style="color: #db9652;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Continue&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;For&lt;/SPAN&gt;
		
		&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;facDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;GetFactoryDocument&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;refDoc&lt;/SPAN&gt;)
		&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;modelStates&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ModelStates&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;facDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ModelStates&lt;/SPAN&gt;
		&lt;SPAN style="color: #ce5c95;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ModelState&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ModelState&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;modelStates&lt;/SPAN&gt;
			&lt;SPAN style="color: #db9652;"&gt;ModelState&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Activate&lt;/SPAN&gt;()
			&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;partParams&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;facDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;UserParameters&lt;/SPAN&gt;
			&lt;SPAN style="color: #ce5c95;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameter&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;asmParams&lt;/SPAN&gt;
				&lt;SPAN style="color: #ce5c95;"&gt;Try&lt;/SPAN&gt;
					&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;UserParameter&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;partParams&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Name&lt;/SPAN&gt;)
					&lt;SPAN style="color: #db9652;"&gt;checkParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Expression&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Expression&lt;/SPAN&gt;
				&lt;SPAN style="color: #ce5c95;"&gt;Catch&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ex&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Exception&lt;/SPAN&gt;
					&lt;SPAN style="color: #db9652;"&gt;partParams&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;AddByExpression&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Expression&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Units&lt;/SPAN&gt;)
				&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Try&lt;/SPAN&gt;
			&lt;SPAN style="color: #ce5c95;"&gt;Next&lt;/SPAN&gt;
			
		&lt;SPAN style="color: #ce5c95;"&gt;Next&lt;/SPAN&gt;
	&lt;SPAN style="color: #ce5c95;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt;

&lt;SPAN style="color: #ce5c95;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Function&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;GetFactoryDocument&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;doc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Document&lt;/SPAN&gt;)
	&lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; (&lt;SPAN style="color: #db9652;"&gt;doc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt;) &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Return&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt;
	
	&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;documentType&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;DocumentTypeEnum&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DocumentType&lt;/SPAN&gt;
	&lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; (&lt;SPAN style="color: #db9652;"&gt;documentType&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Or&lt;/SPAN&gt; 
		&lt;SPAN style="color: #db9652;"&gt;documentType&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;kAssemblyDocumentObject&lt;/SPAN&gt;) &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt;
		
		&lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;componentDefinition&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;
		&lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; (&lt;SPAN style="color: #db9652;"&gt;componentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;IsModelStateMember&lt;/SPAN&gt;) &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt;
			&lt;SPAN style="color: #ce5c95;"&gt;Return&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;componentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;FactoryDocument&lt;/SPAN&gt;
		&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt;	
		
		&lt;SPAN style="color: #ce5c95;"&gt;Return&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;doc&lt;/SPAN&gt;
	&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt;
	&lt;SPAN style="color: #ce5c95;"&gt;Return&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Nothing&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Function&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Aug 2021 13:39:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10527779#M47398</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2021-08-07T13:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Copy user parameters from assembly to parts</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10539535#M47399</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just wanted to say thank you and I know this research and post on your blog is going to help a lot of people.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;People like you who makes life much easier.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 08:02:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10539535#M47399</guid>
      <dc:creator>helouise</dc:creator>
      <dc:date>2021-08-12T08:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Copy user parameters from assembly to parts</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10539543#M47400</link>
      <description>I'm probably being an Idiot right now but what is Kudos?</description>
      <pubDate>Thu, 12 Aug 2021 08:05:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10539543#M47400</guid>
      <dc:creator>helouise</dc:creator>
      <dc:date>2021-08-12T08:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Copy user parameters from assembly to parts</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10566909#M47401</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10150147"&gt;@helouise&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;let me add a thing that could help to understand model states better.&lt;BR /&gt;&lt;BR /&gt;In this specific case, and in general for legacy code written in a world without model states, it's useless to loop through the model states, you're setting the same value for all model states.&lt;BR /&gt;Let's suppose the part doesn't have the assembly parameter you want to propagate; the first time you run the code above for the active model state (the active in the factory, not the active in the occurrence) you'll add the parameter, for the next model states you'll just set the parameter value which already is what you want!&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;Let's delete the model states loop then!&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;yes but no! because if you do that, the second time you run the code, supposing the part already has the parameter and the assembly parameter has changed, you'll set the assembly value just for the active model state (again, the active model state in the factory) and you've basically started to leveraging the model states concept: you'll get the active model state with current assembly's parameter value but the other model states with the previous value.&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;That was exactly the purpose of the loop you've just told me to delete!&lt;/EM&gt;&lt;BR /&gt;Here's your brand new API perfectly fitting your needs: ModelStates.MemberEditScope&lt;BR /&gt;Instead of looping model states, set the scope to work with all members&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;modelStates&lt;/SPAN&gt;.&lt;SPAN&gt;MemberEditScope&lt;/SPAN&gt; = &lt;SPAN&gt;MemberEditScopeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kEditAllMembers&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Any edit done to the factory is now applied to all model states no matter what is the active one, so set or add the parameter and then switch back to the edit scope to its original value.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 16:03:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10566909#M47401</guid>
      <dc:creator>CattabianiI</dc:creator>
      <dc:date>2021-08-23T16:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Copy user parameters from assembly to parts</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10895641#M47402</link>
      <description>&lt;P&gt;it works smoothly,&lt;BR /&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 08:25:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10895641#M47402</guid>
      <dc:creator>Nassim.SulaimanPPKUE</dc:creator>
      <dc:date>2022-01-21T08:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Copy user parameters from assembly to parts</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10927044#M47403</link>
      <description>&lt;P&gt;it works fine, unless you have a Text or yes/NO Parameter or an Unitless Param.&lt;BR /&gt;is there any way to Include / exclude these two Parameter Type?&lt;BR /&gt;thanks in Advance&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 20:33:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/10927044#M47403</guid>
      <dc:creator>Nassim.SulaimanPPKUE</dc:creator>
      <dc:date>2022-02-03T20:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Copy user parameters from assembly to parts</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/11877290#M47404</link>
      <description>&lt;P&gt;I am using something similar. however mine controls the 3D sketch overall dimensions via a form. it works great without any frame generated parts. However, when you use the form with frame generated parts it has error codes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;manually, if i suppress all the parts except the 3D sketch part. change the dimensions on the form and unsuppress the other parts the update takes place for the 3D sketch. then i have to rebuild all in the manage tab for the changes to affect the frame generated parts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="benWBWZL_1-1680779176327.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1199143iFA4E64E5E636CB4E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="benWBWZL_1-1680779176327.png" alt="benWBWZL_1-1680779176327.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="benWBWZL_0-1680779067615.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1199141iC439B7F1CCACC6DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="benWBWZL_0-1680779067615.png" alt="benWBWZL_0-1680779067615.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="benWBWZL_2-1680779334176.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1199144i2532A7599B67A97C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="benWBWZL_2-1680779334176.png" alt="benWBWZL_2-1680779334176.png" /&gt;&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;&lt;SPAN&gt;Public&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;Main&lt;/SPAN&gt;()

    &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;SilentOperation&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt; &lt;SPAN&gt;'Suppress screen updates&lt;/SPAN&gt;

    &lt;SPAN&gt;CopyUserParams&lt;/SPAN&gt;()

    &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;SilentOperation&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt; &lt;SPAN&gt;'Unsuppress screen updates&lt;/SPAN&gt;

    &lt;SPAN&gt;' Get a reference to the active assembly document.&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;asmDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;

    &lt;SPAN&gt;' Update the assembly document.&lt;/SPAN&gt;
    &lt;SPAN&gt;asmDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Update&lt;/SPAN&gt;()

    &lt;SPAN&gt;' Rebuild the assembly document.&lt;/SPAN&gt;
    &lt;SPAN&gt;asmDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Rebuild&lt;/SPAN&gt;()

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;

&lt;SPAN&gt;Private&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;CopyUserParams&lt;/SPAN&gt;()

    &lt;SPAN&gt;' Check if the active document is an assembly.&lt;/SPAN&gt;
    &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kAssemblyDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;

        &lt;SPAN&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;"The active document must be an assembly."&lt;/SPAN&gt;)
        &lt;SPAN&gt;Return&lt;/SPAN&gt;

    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;asmDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;

    &lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;refDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;asmDoc&lt;/SPAN&gt;.&lt;SPAN&gt;AllReferencedDocuments&lt;/SPAN&gt;

        &lt;SPAN&gt;' Look for part documents.&lt;/SPAN&gt;
        &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;refDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;

            &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;partDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN&gt;refDoc&lt;/SPAN&gt;
            &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;refDocUserParams&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;UserParameters&lt;/SPAN&gt; = &lt;SPAN&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN&gt;UserParameters&lt;/SPAN&gt;

            &lt;SPAN&gt;' Add the assembly parameters to the part.&lt;/SPAN&gt;
            &lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;asmUserParam&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;UserParameter&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;asmDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN&gt;UserParameters&lt;/SPAN&gt;

                &lt;SPAN&gt;' Check to see if the parameter already exists.&lt;/SPAN&gt;
                &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;checkParam&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;UserParameter&lt;/SPAN&gt; = &lt;SPAN&gt;Nothing&lt;/SPAN&gt;

                &lt;SPAN&gt;Try&lt;/SPAN&gt;
                    &lt;SPAN&gt;checkParam&lt;/SPAN&gt; = &lt;SPAN&gt;refDocUserParams&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;)
                &lt;SPAN&gt;Catch&lt;/SPAN&gt; &lt;SPAN&gt;ex&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Exception&lt;/SPAN&gt;
                    &lt;SPAN&gt;checkParam&lt;/SPAN&gt; = &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
                &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;

                &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;checkParam&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
                    &lt;SPAN&gt;' Create the missing parameter.&lt;/SPAN&gt;
                    &lt;SPAN&gt;refDocUserParams&lt;/SPAN&gt;.&lt;SPAN&gt;AddByExpression&lt;/SPAN&gt;(&lt;SPAN&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;, &lt;SPAN&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN&gt;Expression&lt;/SPAN&gt;, &lt;SPAN&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN&gt;Units&lt;/SPAN&gt;)
                &lt;SPAN&gt;Else&lt;/SPAN&gt;
                    &lt;SPAN&gt;' Update the value of the existing parameter.&lt;/SPAN&gt;
                    &lt;SPAN&gt;checkParam&lt;/SPAN&gt;.&lt;SPAN&gt;Expression&lt;/SPAN&gt; = &lt;SPAN&gt;asmUserParam&lt;/SPAN&gt;.&lt;SPAN&gt;Expression&lt;/SPAN&gt;
                &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

            &lt;SPAN&gt;Next&lt;/SPAN&gt;

        &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

    &lt;SPAN&gt;Next&lt;/SPAN&gt;

    &lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN&gt;UpdateWhenDone&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;is there a way i can achieve the rebuild all at the instance i click set parameters in the form?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm new to iLogic and Forms.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ben&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 11:12:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-user-parameters-from-assembly-to-parts/m-p/11877290#M47404</guid>
      <dc:creator>PumaBH</dc:creator>
      <dc:date>2023-04-06T11:12:21Z</dc:date>
    </item>
  </channel>
</rss>

