<?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: Updating user parameter with ilogic in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10156929#M122161</link>
    <description>&lt;P&gt;The iProperties are updating, but I want my factory propererties to update as well.&lt;/P&gt;&lt;P&gt;The ID_Number is set to "X" as default.&lt;/P&gt;&lt;P&gt;Is it possible to synchronize these two values?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Properties would not update.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/893205i8C0586AAEE978CB0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Properties would not update.png" alt="Properties would not update.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Mar 2021 09:30:49 GMT</pubDate>
    <dc:creator>ejaL9K8H</dc:creator>
    <dc:date>2021-03-15T09:30:49Z</dc:date>
    <item>
      <title>Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10147504#M122027</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to change the user parameter of an Asset model from an Assemply.&lt;/P&gt;&lt;P&gt;I would like my user paramter "ID_Number" to be equal to to the item number from the Bill of Materials.&lt;/P&gt;&lt;P&gt;I have used folowing code, but every time i run it, Inventor freezes and crashses...&lt;/P&gt;&lt;P&gt;What is the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;doc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAssyDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;doc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBOM&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BOM&lt;/SPAN&gt; = &lt;SPAN&gt;oAssyDef&lt;/SPAN&gt;.&lt;SPAN&gt;BOM&lt;/SPAN&gt;

&lt;SPAN&gt;oBOM&lt;/SPAN&gt;.&lt;SPAN&gt;StructuredViewEnabled&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBOMView&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BOMView&lt;/SPAN&gt; = &lt;SPAN&gt;oBOM&lt;/SPAN&gt;.&lt;SPAN&gt;BOMViews&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Structured"&lt;/SPAN&gt;)
&lt;SPAN&gt;' Set the Row Merge Settings&lt;/SPAN&gt;
&lt;SPAN&gt;oBOM&lt;/SPAN&gt;.&lt;SPAN&gt;SetPartNumberMergeSettings&lt;/SPAN&gt;(&lt;SPAN&gt;False&lt;/SPAN&gt;)

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBOMRow&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BOMRow&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oBOMRow&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oBOMView&lt;/SPAN&gt;.&lt;SPAN&gt;BOMRows&lt;/SPAN&gt;
    &lt;SPAN&gt;'Set a reference to the primary ComponentDefinition of the row&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
    &lt;SPAN&gt;oCompDef&lt;/SPAN&gt; = &lt;SPAN&gt;oBOMRow&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinitions&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(1)
    
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;CompFullDocumentName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;oCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;FullDocumentName&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;CompFileNameOnly&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;index&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt; = &lt;SPAN&gt;CompFullDocumentName&lt;/SPAN&gt;.&lt;SPAN&gt;LastIndexOf&lt;/SPAN&gt;(&lt;SPAN&gt;"\"&lt;/SPAN&gt;)
    
    &lt;SPAN&gt;CompFileNameOnly&lt;/SPAN&gt; = &lt;SPAN&gt;CompFullDocumentName&lt;/SPAN&gt;.&lt;SPAN&gt;Substring&lt;/SPAN&gt;(&lt;SPAN&gt;index&lt;/SPAN&gt; + 1)

	&lt;SPAN&gt;ItemNumber&lt;/SPAN&gt; = &lt;SPAN&gt;oBOMRow&lt;/SPAN&gt;.&lt;SPAN&gt;ItemNumber&lt;/SPAN&gt;

 	&lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;CompFileNameOnly&lt;/SPAN&gt;, &lt;SPAN&gt;"ID_Number"&lt;/SPAN&gt;) = &lt;SPAN&gt;ItemNumber&lt;/SPAN&gt;


&lt;SPAN&gt;Next&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 08:12:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10147504#M122027</guid>
      <dc:creator>ejaL9K8H</dc:creator>
      <dc:date>2021-03-11T08:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10154648#M122120</link>
      <description>&lt;P&gt;Is the parameter&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;CompFileNameOnly&lt;/SPAN&gt;, &lt;SPAN&gt;"ID_Number"&lt;/SPAN&gt;) = &lt;SPAN&gt;ItemNumber&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Always in the model available?&lt;/P&gt;
&lt;P&gt;Otherwise you need to add that first!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Mar 2021 23:46:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10154648#M122120</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2021-03-13T23:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10156607#M122147</link>
      <description>&lt;P&gt;Yes the parameter is always&amp;nbsp;&lt;SPAN&gt;available in the model.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I Added:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN&gt;UpdateWhenDone&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The iproperties updates after the new parameter, but the paramter in factory properties remains the same..&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 06:02:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10156607#M122147</guid>
      <dc:creator>ejaL9K8H</dc:creator>
      <dc:date>2021-03-15T06:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10156818#M122156</link>
      <description>&lt;LI-CODE lang="general"&gt;doc = ThisDoc.Document
Dim oAssyDef As AssemblyComponentDefinition = doc.ComponentDefinition
Dim oBOM As BOM = oAssyDef.BOM

oBOM.StructuredViewEnabled = True
Dim oBOMView As BOMView = oBOM.BOMViews.Item("Structured")
' Set the Row Merge Settings
oBOM.SetPartNumberMergeSettings(False)

Dim oBOMRow As BOMRow = Nothing
Dim oDoc As Inventor.Document
For Each oBOMRow In oBOMView.BOMRows
    'Set a reference to the primary ComponentDefinition of the row
    Dim oCompDef As ComponentDefinition
    oCompDef = oBOMRow.ComponentDefinitions.Item(1)
    
	oDoc = oCompDef.Document
	'Doc.FullFileName
    Dim CompFullDocumentName As String = oDoc.FullFileName'oCompDef.Document.fullfilename
    Dim CompFileNameOnly As String
    Dim index As Integer = CompFullDocumentName.LastIndexOf("\")
    
    CompFileNameOnly = CompFullDocumentName.Substring(index + 1)

	ItemNumber = oBOMRow.ItemNumber
	
 	Parameter(CompFileNameOnly, "ID_Number") = ItemNumber


Next&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 15 Mar 2021 08:36:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10156818#M122156</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2021-03-15T08:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10156929#M122161</link>
      <description>&lt;P&gt;The iProperties are updating, but I want my factory propererties to update as well.&lt;/P&gt;&lt;P&gt;The ID_Number is set to "X" as default.&lt;/P&gt;&lt;P&gt;Is it possible to synchronize these two values?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Properties would not update.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/893205i8C0586AAEE978CB0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Properties would not update.png" alt="Properties would not update.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 09:30:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10156929#M122161</guid>
      <dc:creator>ejaL9K8H</dc:creator>
      <dc:date>2021-03-15T09:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10156931#M122162</link>
      <description>&lt;P&gt;This ilogic rule, is what updates the iproperties in the part/asset&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"ID Number"&lt;/SPAN&gt;) = &lt;SPAN&gt;ID_Number&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 09:32:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10156931#M122162</guid>
      <dc:creator>ejaL9K8H</dc:creator>
      <dc:date>2021-03-15T09:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10156983#M122164</link>
      <description>&lt;P&gt;What do you mean with Factory?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 10:00:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10156983#M122164</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2021-03-15T10:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10156996#M122165</link>
      <description>&lt;P&gt;By Factory i mean the "Factory Properties" (at the left-hand-side) which follows the user parameters from the part/asset.&lt;/P&gt;&lt;P&gt;I am trying to biuld a Factory layout as an assembly which are buildup with Assets.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 10:05:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10156996#M122165</guid>
      <dc:creator>ejaL9K8H</dc:creator>
      <dc:date>2021-03-15T10:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10157002#M122166</link>
      <description>&lt;P&gt;For "Factory Design Suite"?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 10:10:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10157002#M122166</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2021-03-15T10:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10157023#M122167</link>
      <description>&lt;P&gt;It is Assets properties which can be found in this menu:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ejaL9K8H_0-1615803327181.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/893227i2F7072823E215DD6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ejaL9K8H_0-1615803327181.png" alt="ejaL9K8H_0-1615803327181.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 10:16:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10157023#M122167</guid>
      <dc:creator>ejaL9K8H</dc:creator>
      <dc:date>2021-03-15T10:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10157027#M122168</link>
      <description>&lt;P&gt;Nomally it updates with the assets user parameter:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ejaL9K8H_1-1615803406540.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/893230i5BF0429EEBD78A9E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ejaL9K8H_1-1615803406540.png" alt="ejaL9K8H_1-1615803406540.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 10:16:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10157027#M122168</guid>
      <dc:creator>ejaL9K8H</dc:creator>
      <dc:date>2021-03-15T10:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10157060#M122170</link>
      <description>&lt;P&gt;What Version of Inventor are you using?&lt;/P&gt;
&lt;P&gt;And what vertical are you using, "Factory Design Suite"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 10:28:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10157060#M122170</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2021-03-15T10:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10157071#M122171</link>
      <description>&lt;P&gt;I am using&amp;nbsp;Autodesk® Factory Design Utilities, Version 2020.1.3&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 10:31:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10157071#M122171</guid>
      <dc:creator>ejaL9K8H</dc:creator>
      <dc:date>2021-03-15T10:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10157131#M122174</link>
      <description>&lt;P&gt;I can't help you with that since I have not Inventor Factory Design installed!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 10:58:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10157131#M122174</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2021-03-15T10:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10194910#M122767</link>
      <description>&lt;P&gt;I found a solution, but it is only working if i Run it as 2 separately codes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Firstly the ID number is updated:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;' Update ID Number&lt;/SPAN&gt;
&lt;SPAN&gt;' Item Number = ID Number&lt;/SPAN&gt;

&lt;SPAN&gt;doc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAssyDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;doc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBOM&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BOM&lt;/SPAN&gt; = &lt;SPAN&gt;oAssyDef&lt;/SPAN&gt;.&lt;SPAN&gt;BOM&lt;/SPAN&gt;

&lt;SPAN&gt;oBOM&lt;/SPAN&gt;.&lt;SPAN&gt;StructuredViewEnabled&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBOMView&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BOMView&lt;/SPAN&gt; = &lt;SPAN&gt;oBOM&lt;/SPAN&gt;.&lt;SPAN&gt;BOMViews&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Structured"&lt;/SPAN&gt;)
&lt;SPAN&gt;' Set the Row Merge Settings&lt;/SPAN&gt;
&lt;SPAN&gt;oBOM&lt;/SPAN&gt;.&lt;SPAN&gt;SetPartNumberMergeSettings&lt;/SPAN&gt;(&lt;SPAN&gt;False&lt;/SPAN&gt;)

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBOMRow&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BOMRow&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oBOMRow&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oBOMView&lt;/SPAN&gt;.&lt;SPAN&gt;BOMRows&lt;/SPAN&gt;
    &lt;SPAN&gt;'Set a reference to the primary ComponentDefinition of the row&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
    &lt;SPAN&gt;oCompDef&lt;/SPAN&gt; = &lt;SPAN&gt;oBOMRow&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinitions&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(1)
    
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;CompFullDocumentName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;oCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;FullDocumentName&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;CompFileNameOnly&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;index&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt; = &lt;SPAN&gt;CompFullDocumentName&lt;/SPAN&gt;.&lt;SPAN&gt;LastIndexOf&lt;/SPAN&gt;(&lt;SPAN&gt;"\"&lt;/SPAN&gt;)
    
    &lt;SPAN&gt;CompFileNameOnly&lt;/SPAN&gt; = &lt;SPAN&gt;CompFullDocumentName&lt;/SPAN&gt;.&lt;SPAN&gt;Substring&lt;/SPAN&gt;(&lt;SPAN&gt;index&lt;/SPAN&gt; + 1)
	
	&lt;SPAN&gt;Try&lt;/SPAN&gt;
	&lt;SPAN&gt;ItemNumber&lt;/SPAN&gt; = &lt;SPAN&gt;oBOMRow&lt;/SPAN&gt;.&lt;SPAN&gt;ItemNumber&lt;/SPAN&gt;
	
 	&lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;CompFileNameOnly&lt;/SPAN&gt;, &lt;SPAN&gt;"ID_Number"&lt;/SPAN&gt;) = &lt;SPAN&gt;ItemNumber&lt;/SPAN&gt;
	&lt;SPAN&gt;Catch&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&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;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Secondly an Asset Tag is made, which updates the all asset models:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;AddReference&lt;/SPAN&gt; &lt;SPAN&gt;"Autodesk.Factory.PublicAPI.dll"&lt;/SPAN&gt;
&lt;SPAN&gt;Imports&lt;/SPAN&gt; &lt;SPAN&gt;Autodesk&lt;/SPAN&gt;.&lt;SPAN&gt;Factory&lt;/SPAN&gt;.&lt;SPAN&gt;PublicAPI&lt;/SPAN&gt;.&lt;SPAN&gt;Currency&lt;/SPAN&gt;.&lt;SPAN&gt;v2&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;Main&lt;/SPAN&gt;()

&lt;SPAN&gt;' set a reference to the assembly component definintion.&lt;/SPAN&gt;
&lt;SPAN&gt;' This assumes an assembly document is open.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsmCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;oAsmCompDef&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;

&lt;SPAN&gt;'Set up a variable for the component cccurrence&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt;, &lt;SPAN&gt;factoryInstance&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;IAssetInstance&lt;/SPAN&gt;

&lt;SPAN&gt;'Access the Browser and Activate the "Bim Content" Browser Pane&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBrowserPanes&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;BrowserPanes&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;Model_Browser_Pane&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BrowserPane&lt;/SPAN&gt; = &lt;SPAN&gt;oBrowserPanes&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Model"&lt;/SPAN&gt;)
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oOccNode&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BrowserNode&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oAsmCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;Occurrences&lt;/SPAN&gt;
	 &lt;SPAN&gt;Try&lt;/SPAN&gt;
 &lt;SPAN&gt;If&lt;/SPAN&gt; (&lt;SPAN&gt;Not&lt;/SPAN&gt; &lt;SPAN&gt;IsFactoryInstance&lt;/SPAN&gt;(&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;, &lt;SPAN&gt;oOcc&lt;/SPAN&gt;, &lt;SPAN&gt;factoryInstance&lt;/SPAN&gt;)) &lt;SPAN&gt;Then&lt;/SPAN&gt;
  &lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;" is NOT a Factory Asset"&lt;/SPAN&gt;, &lt;SPAN&gt;"Title"&lt;/SPAN&gt;)
 &lt;SPAN&gt;Else&lt;/SPAN&gt; 
  &lt;SPAN&gt;oOccNode&lt;/SPAN&gt; = &lt;SPAN&gt;Model_Browser_Pane&lt;/SPAN&gt;.&lt;SPAN&gt;TopNode&lt;/SPAN&gt;.&lt;SPAN&gt;BrowserNodes&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;)
  &lt;SPAN&gt;oOccNode&lt;/SPAN&gt;.&lt;SPAN&gt;DoSelect&lt;/SPAN&gt;
  &lt;SPAN&gt;ChangeAssetTag&lt;/SPAN&gt;(&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;, &lt;SPAN&gt;oOcc&lt;/SPAN&gt;, &lt;SPAN&gt;factoryInstance&lt;/SPAN&gt;)
 &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
	&lt;SPAN&gt;Catch&lt;/SPAN&gt;
  	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;

&lt;SPAN&gt;Next&lt;/SPAN&gt;

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;

&lt;SPAN&gt;'Use this Function To see If the models are Assets&lt;/SPAN&gt;
&lt;SPAN&gt;Function&lt;/SPAN&gt; &lt;SPAN&gt;IsFactoryInstance&lt;/SPAN&gt;(&lt;SPAN&gt;layoutDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt;, &lt;SPAN&gt;oOcc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt;, &lt;SPAN&gt;ByRef&lt;/SPAN&gt; &lt;SPAN&gt;factoryInstance&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;IAssetInstance&lt;/SPAN&gt;)
 &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;instances&lt;/SPAN&gt; = &lt;SPAN&gt;Autodesk&lt;/SPAN&gt;.&lt;SPAN&gt;Factory&lt;/SPAN&gt;.&lt;SPAN&gt;PublicAPI&lt;/SPAN&gt;.&lt;SPAN&gt;API&lt;/SPAN&gt;.&lt;SPAN&gt;Instance&lt;/SPAN&gt;.&lt;SPAN&gt;GetAssetInstances&lt;/SPAN&gt;(&lt;SPAN&gt;layoutDoc&lt;/SPAN&gt;)
 &lt;SPAN&gt;found&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt;
 &lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;instance&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;instances&lt;/SPAN&gt;
  &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;instance&lt;/SPAN&gt;.&lt;SPAN&gt;NativeObject&lt;/SPAN&gt;.&lt;SPAN&gt;Equals&lt;/SPAN&gt;(&lt;SPAN&gt;oOcc&lt;/SPAN&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt;
   &lt;SPAN&gt;factoryInstance&lt;/SPAN&gt; = &lt;SPAN&gt;instance&lt;/SPAN&gt;
   &lt;SPAN&gt;found&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;
   &lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;For&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;Return&lt;/SPAN&gt; &lt;SPAN&gt;found&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Function&lt;/SPAN&gt;

&lt;SPAN&gt;'The public subroutine will allow the editing of Asset Tags&lt;/SPAN&gt;
&lt;SPAN&gt;Public&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;ChangeAssetTag&lt;/SPAN&gt;(&lt;SPAN&gt;layoutDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt;, &lt;SPAN&gt;oOcc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt;, &lt;SPAN&gt;Asset_Instance&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;IAssetInstance&lt;/SPAN&gt;)
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;grp&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;Asset_Instance&lt;/SPAN&gt;.&lt;SPAN&gt;PropertyGroups&lt;/SPAN&gt;
 &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;grp&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;"AssetTag"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
  &lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;prop&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;grp&lt;/SPAN&gt;.&lt;SPAN&gt;Properties&lt;/SPAN&gt;
   &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;prop&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;"Asset Tag"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
	    &lt;SPAN&gt;New_Value&lt;/SPAN&gt; = &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;, &lt;SPAN&gt;"ID_Number"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN&gt;" - "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;, &lt;SPAN&gt;"Project"&lt;/SPAN&gt; ,&lt;SPAN&gt;"Part Number"&lt;/SPAN&gt;) 
    	&lt;SPAN&gt;prop&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN&gt;New_Value&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;'After changed some value, you need To update the instance&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;ins&lt;/SPAN&gt;() &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;IAssetInstance&lt;/SPAN&gt;={&lt;SPAN&gt;Asset_Instance&lt;/SPAN&gt;}
&lt;SPAN&gt;Autodesk&lt;/SPAN&gt;.&lt;SPAN&gt;Factory&lt;/SPAN&gt;.&lt;SPAN&gt;PublicAPI&lt;/SPAN&gt;.&lt;SPAN&gt;API&lt;/SPAN&gt;.&lt;SPAN&gt;Instance&lt;/SPAN&gt;.&lt;SPAN&gt;UpdateAssetInstances&lt;/SPAN&gt;(&lt;SPAN&gt;layoutDoc&lt;/SPAN&gt;,&lt;SPAN&gt;ins&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;&lt;/P&gt;&lt;P&gt;Is it possible to merge these two codes and improve them?&lt;/P&gt;&lt;P&gt;I would like the code to save computer capacity and work faster.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance&amp;nbsp;&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;</description>
      <pubDate>Mon, 29 Mar 2021 07:02:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10194910#M122767</guid>
      <dc:creator>ejaL9K8H</dc:creator>
      <dc:date>2021-03-29T07:02:25Z</dc:date>
    </item>
    <item>
      <title>Betreff: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10195374#M122769</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't have Factory Design Utilities installed, so I can't test it. Maybe it runs anyway.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AddReference "Autodesk.Factory.PublicAPI.dll"
Imports Autodesk.Factory.PublicAPI.Currency.v2

Sub Main()

' Update ID Number
' Item Number = ID Number

Dim oDoc = ThisDoc.Document
Dim oAssyDef As AssemblyComponentDefinition = doc.ComponentDefinition
Dim oBOM As BOM = oAssyDef.BOM

oBOM.StructuredViewEnabled = True
Dim oBOMView As BOMView = oBOM.BOMViews.Item("Structured")
' Set the Row Merge Settings
oBOM.SetPartNumberMergeSettings(False)

Dim oBOMRow As BOMRow

For Each oBOMRow In oBOMView.BOMRows
    'Set a reference to the primary ComponentDefinition of the row
    Dim oCompDef As ComponentDefinition
    oCompDef = oBOMRow.ComponentDefinitions.Item(1)
    
    Dim CompFullDocumentName As String = oCompDef.Document.FullDocumentName
    Dim CompFileNameOnly As String
    Dim index As Integer = CompFullDocumentName.LastIndexOf("\")
    
    CompFileNameOnly = CompFullDocumentName.Substring(index + 1)
	
	Try
		ItemNumber = oBOMRow.ItemNumber
	 	Parameter(CompFileNameOnly, "ID_Number") = ItemNumber
	Catch
	End Try
	
	If IsFactoryInstance(oDoc, oCompDef.Document, factoryInstance)) Then
		ChangeAssetTag(oDoc, oCompDef.Document, factoryInstance)
	End if

Next
iLogicVb.UpdateWhenDone = True

End Sub

'Use this Function To see If the models are Assets
Function IsFactoryInstance(layoutDoc As Document, oDoc As Document, ByRef factoryInstance As IAssetInstance)
	 Dim instances = Autodesk.Factory.PublicAPI.API.Instance.GetAssetInstances(layoutDoc)
	 Dim found as Boolean=False
	 For Each instance In instances
	  If instance.NativeObject.Definition.Document.Equals(oDoc) Then
	   factoryInstance = instance
	   found=true
	   Exit For
	  End If
	 Next
	 
	 Return found
End Function

'The public subroutine will allow the editing of Asset Tags
Public Sub ChangeAssetTag(layoutDoc As Document, oDoc As Document, Asset_Instance As IAssetInstance)
	For Each grp In Asset_Instance.PropertyGroups
	 If grp.Name = "AssetTag" Then
	  For Each prop In grp.Properties
	   If prop.Name = "Asset Tag" Then
			New_Value = Parameter(oDoc.Name, "ID_Number") &amp;amp; " - " &amp;amp; iProperties.Value(oDoc.Name, "Project" ,"Part Number") 
			prop.Value = New_Value
	   End If
	  Next
	 End If
Next

'After changed some value, you need To update the instance
Dim ins() As IAssetInstance={Asset_Instance}
Autodesk.Factory.PublicAPI.API.Instance.UpdateAssetInstances(layoutDoc,ins)
End Sub&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 Mar 2021 10:34:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10195374#M122769</guid>
      <dc:creator>Ralf_Krieg</dc:creator>
      <dc:date>2021-03-29T10:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10195450#M122771</link>
      <description>&lt;P&gt;This messages is showed:&lt;/P&gt;&lt;P&gt;Error in rule&lt;/P&gt;&lt;P&gt;The public member 'Name' of the type 'PartDocument' was not found.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 11:03:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10195450#M122771</guid>
      <dc:creator>ejaL9K8H</dc:creator>
      <dc:date>2021-03-29T11:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10195635#M122775</link>
      <description>&lt;P&gt;In this line:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;New_Value = Parameter(oDoc.Name, "ID_Number") &amp;amp; " - " &amp;amp; iProperties.Value(oDoc.Name, "Project" ,"Part Number")&lt;/LI-CODE&gt;&lt;P&gt;Try replacing oDoc.Name with oDoc.DisplayName.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 12:18:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10195635#M122775</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-03-29T12:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10195788#M122780</link>
      <description>&lt;P&gt;Still getting an error message:&lt;/P&gt;&lt;P&gt;Error in rule:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Parameter: The component named "Test" was not found.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 13:05:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10195788#M122780</guid>
      <dc:creator>ejaL9K8H</dc:creator>
      <dc:date>2021-03-29T13:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Updating user parameter with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10195893#M122781</link>
      <description>&lt;P&gt;Hmm.... Just 'shooting from the hip' here, but I'm thinking the problem may still be in that same line.&amp;nbsp; Sometimes using 'DisplayName' works OK, and sometimes it doesn't, depending on how you have things set-up.&amp;nbsp; Try using oDoc.FullDocumentName instead of oDoc.DisplayName.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 13:40:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/updating-user-parameter-with-ilogic/m-p/10195893#M122781</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-03-29T13:40:13Z</dc:date>
    </item>
  </channel>
</rss>

