<?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: How to assign Structured Item numbers to a Iproperties field in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/8848543#M98327</link>
    <description>&lt;P&gt;Hi!&lt;BR /&gt;Hi!!&lt;/P&gt;
&lt;P&gt;The code is running well at some point, except these two points:&lt;/P&gt;
&lt;P&gt;An error arises and i think it's because of:&lt;/P&gt;
&lt;P&gt;1- I use a LOD iLogic&lt;/P&gt;
&lt;P&gt;2- I have library and content center parts&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The questions are:&lt;/P&gt;
&lt;P&gt;A) how can i avoid the error message?&lt;/P&gt;
&lt;P&gt;(I tried the " on error resume", but it's incompatible with the "try" statement).&lt;/P&gt;
&lt;P&gt;(Also tried the "if the part is modificable= true then", but i think this will not work for this case).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;B) The code will work for a LOD other than Master?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2019 00:52:08 GMT</pubDate>
    <dc:creator>CCarreiras</dc:creator>
    <dc:date>2019-06-13T00:52:08Z</dc:date>
    <item>
      <title>How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5629344#M55788</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would love to have a ILogic rules that I could run in my main assembly and that would place the structured item numbers from the BOM into one of the standard Iproperties fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to use it to create a titlefield above views that incluse the Itemnumber of that part / subassembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does one of you have ideas how to do this. I know not enough of programming in ILogic to do it myself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greeting from Norway,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Toon&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 10:13:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5629344#M55788</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-11T10:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5629679#M55798</link>
      <description>&lt;P&gt;Similar discussion was had in this thread:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_self" href="https://forums.autodesk.com/t5/inventor-customization/make-a-custom-iproperty-equal-to-the-item-in-the-parts-only-bom/td-p/5523268"&gt;http://forums.autodesk.com/t5/inventor-customization/make-a-custom-iproperty-equal-to-the-item-in-the-parts-only-bom/td-p/5523268&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll need to change "Parts Only" to "Structured" and the iProperty that you want to use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BrandonBG&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 14:37:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5629679#M55798</guid>
      <dc:creator>BrandonBG</dc:creator>
      <dc:date>2015-05-11T14:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5629910#M55803</link>
      <description>&lt;P&gt;Hei BrandonBG,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the tip but when I use that first code I get an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;Error in rule: Rule1, in document: 7951 P02 Rømningstrapp.iam&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ran the rule while standing in the main assembly. Right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim oAssemblyDocument As AssemblyDocument 
oAssemblyDocument= ThisDoc.Document

Dim oAssemblyComponentDefinition As AssemblyComponentDefinition 
oAssemblyComponentDefinition = oAssemblyDocument.ComponentDefinition

Dim oBOM As BOM 
oBOM = oAssemblyComponentDefinition.BOM

oBOM.PartsOnlyViewEnabled = True
Dim oBOMView As BOMView 
oBOMView = oBOM.BOMViews.Item("Parts Only") &lt;EM&gt;'or structured&lt;/EM&gt;

For Each oBOMRow As BOMRow In oBOMView.BOMRows
  Dim oComponentDefinition As ComponentDefinition 
  oComponentDefinition = oBOMRow.ComponentDefinitions.Item(1)
	
  Dim oBOMItemNumber As String
  oBOMItemNumber = oBOMRow.ItemNumber() &lt;EM&gt;'this is item number in the BOM&lt;/EM&gt;
	
  MessageBox.Show(oBOMItemNumber, "BOM Number") &lt;EM&gt;'just to show what's going on&lt;/EM&gt;
	
  Dim oComponentDefinitionPropertySet As PropertySet
  oComponentDefinitionPropertySet = oComponentDefinition.Document.PropertySets.Item("Inventor User Defined Properties") &lt;BR /&gt;     &lt;EM&gt;'custom property tab&lt;/EM&gt;
	
  oComponentDefinitionPropertySet.Add(oBOMItemNumber, "BOM Number") &lt;BR /&gt;     &lt;EM&gt;'creates the custom property and inputs the value&lt;/EM&gt;
	
Next&lt;/PRE&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, 11 May 2015 16:43:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5629910#M55803</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-11T16:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5629927#M55804</link>
      <description>&lt;P&gt;Do you have sub-assemblies? That iLogic isn't built to handle sub-assemblies. You need to run it inside the assembly that contains the .ipt to which you want to assign the new iProperty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 16:50:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5629927#M55804</guid>
      <dc:creator>BrandonBG</dc:creator>
      <dc:date>2015-05-11T16:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5629935#M55805</link>
      <description>&lt;P&gt;That's a bummer. I have always a mix of parts and sub assemblies in my main assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Toon&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 16:52:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5629935#M55805</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-11T16:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5630488#M55811</link>
      <description>&lt;P&gt;Hi, i've had the same problem. This is the rule that i used. Hope this helps you...&lt;/P&gt;&lt;PRE&gt;Sub Main
Dim oAssemblyDocument As AssemblyDocument
oAssemblyDocument = ThisDoc.Document

Dim oAssemblyComponentDefinition As AssemblyComponentDefinition
oAssemblyComponentDefinition = oAssemblyDocument.ComponentDefinition

Dim oBOM As BOM
oBOM = oAssemblyComponentDefinition.BOM
oBom.StructuredViewEnabled = True
Dim oBOMView As BOMView
oBOMView = oBom.BOMViews(2) 'Structured view
oBom.StructuredViewFirstLevelOnly = False
oBom.StructuredViewDelimiter = "."

Call RecursiveCheckAndSetProps(oBOMView.BOMRows)

End Sub

Sub RecursiveCheckAndSetProps(ByVal oRowsElements As BOMRowsEnumerator)

        For Each oBOMRow As BOMRow In oRowsElements
            Dim oComponentDefinition As ComponentDefinition
            oComponentDefinition = oBOMRow.ComponentDefinitions.Item(1)

            Dim oBOMItemNumber As String
            oBOMItemNumber = oBOMRow.ItemNumber() 'this is item number in the BOM
           ' MessageBox.Show(oBOMItemNumber, "BOM Number") 'just to show what's going on
            Dim oComponentDefinitionPropertySet As PropertySet
            oComponentDefinitionPropertySet = oComponentDefinition.Document.PropertySets.Item("Inventor User Defined Properties")
            'custom property tab
 			Try
                'if already exists then set it 
                oComponentDefinitionPropertySet.Item("BOM Number").Value = oBOMItemNumber
            Catch ex As Exception
                'else add it
                oComponentDefinitionPropertySet.Add(oBOMItemNumber, "BOM Number")
            End Try
            'creates the custom property and inputs the value
            If Not oBOMRow.ChildRows Is Nothing Then
				Call RecursiveCheckAndSetProps(oBOMRow.ChildRows)
            End If
        Next
End Sub
		&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 May 2015 23:00:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5630488#M55811</guid>
      <dc:creator>fulvio81</dc:creator>
      <dc:date>2015-05-11T23:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5630628#M55814</link>
      <description>&lt;P&gt;Hallo Fulvio81,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reaction. But when I take your code to make a rule it returns with an error. I made the rule in the main ****. Is that correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the more info from the error:&lt;/P&gt;&lt;P&gt;System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;BR /&gt;at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp;amp; msgData)&lt;BR /&gt;at Inventor.BOMViews.get_Item(Object Index)&lt;BR /&gt;at LmiRuleScript.Main()&lt;BR /&gt;at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)&lt;BR /&gt;at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Toon&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 05:04:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5630628#M55814</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-12T05:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5630633#M55815</link>
      <description>&lt;P&gt;I found it out myself. The assembly was not in the master Level of Detail. After switching it worked fine. Thanks agian. Now I can play with it to make it do what I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 05:12:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5630633#M55815</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-12T05:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5630657#M55816</link>
      <description>&lt;P&gt;I have to aks for help one more time. The code I got works fine but I was trying to modify it so that the itemnumber is being saved in one of the standard Iproperties fields (for example in Project) and not in a custom field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think it is in this part of the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt; &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oComponentDefinitionPropertySet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PropertySet&lt;/SPAN&gt;
            &lt;SPAN&gt;oComponentDefinitionPropertySet&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oComponentDefinition&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Document&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;PropertySets&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Inventor User Defined Properties&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
            &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;custom property tab&lt;/SPAN&gt;
             &lt;SPAN&gt;Try&lt;/SPAN&gt;
                &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;if already exists then set it &lt;/SPAN&gt;
                &lt;SPAN&gt;oComponentDefinitionPropertySet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;BOM Number&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Value&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oBOMItemNumber&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;'&lt;/SPAN&gt;&lt;SPAN&gt;else add it&lt;/SPAN&gt;
                &lt;SPAN&gt;oComponentDefinitionPropertySet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Add&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oBOMItemNumber&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;BOM Number&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
            &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
            &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;creates the custom property and inputs the value&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 May 2015 06:15:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5630657#M55816</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-12T06:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5630759#M55818</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;SPAN style="line-height: 15px;"&gt;you can replace it with&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE&gt;Dim oComponentDefinitionPropertySet As PropertySet
oComponentDefinitionPropertySet = oComponentDefinition.Document.PropertySets.Item(2) 'design tracking
oComponentDefinitionPropertySet.ItemByPropId(Inventor.PropertiesForDesignTrackingPropertiesEnum.kProjectDesignTrackingProperties).Value = oBOMItemNumber&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 May 2015 08:44:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5630759#M55818</guid>
      <dc:creator>fulvio81</dc:creator>
      <dc:date>2015-05-12T08:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5631997#M55837</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Final revised&amp;nbsp;version including both option (custom iProperty and project iProperty)&lt;/P&gt;&lt;P&gt;there was an error&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PropertySets.Item(3)'correct  instead of (2)'wrong&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    Sub Main()
        Dim oAssemblyDocument As AssemblyDocument
        oAssemblyDocument = ThisDoc.Document

        Dim oAssemblyComponentDefinition As AssemblyComponentDefinition
        oAssemblyComponentDefinition = oAssemblyDocument.ComponentDefinition

        Dim oBOM As BOM
        oBOM = oAssemblyComponentDefinition.BOM
        oBom.StructuredViewEnabled = True
        Dim oBOMView As BOMView
        oBOMView = oBom.BOMViews(2) 'Structured view
        oBom.StructuredViewFirstLevelOnly = False
        oBom.StructuredViewDelimiter = "."

        Call RecursiveCheckAndSetProps(oBOMView.BOMRows)

    End Sub

    Sub RecursiveCheckAndSetProps(ByVal oRowsElements As BOMRowsEnumerator)

        For Each oBOMRow As BOMRow In oRowsElements
            Dim oComponentDefinition As ComponentDefinition
            oComponentDefinition = oBOMRow.ComponentDefinitions.Item(1)

            Dim oBOMItemNumber As String
            oBOMItemNumber = oBOMRow.ItemNumber() 'this is item number in the BOM
            ' MessageBox.Show(oBOMItemNumber, "BOM Number") 'just to show what's going on
			
'			'if you want standard iproperty (e.g. "project")        
            Dim oComponentDefinitionPropertySet As PropertySet
            oComponentDefinitionPropertySet = oComponentDefinition.Document.PropertySets.Item(3) 'design tracking
            oComponentDefinitionPropertySet.ItemByPropId(7).Value = oBOMItemNumber  '7 is project property
			
'			'if you want custom iproperty then
'			Dim oComponentDefinitionPropertySet As PropertySet
'            oComponentDefinitionPropertySet = oComponentDefinition.Document.PropertySets.Item("Inventor User Defined Properties")
'            'custom property tab
' 			Try
'                'if already exists then set it 
'                oComponentDefinitionPropertySet.Item("BOM Number").Value = oBOMItemNumber
'            Catch ex As Exception
'                'else add it
'                oComponentDefinitionPropertySet.Add(oBOMItemNumber, "BOM Number")
'            End Try
'            'creates the custom property and inputs the value

            If Not oBOMRow.ChildRows Is Nothing Then
                Call RecursiveCheckAndSetProps(oBOMRow.ChildRows)
            End If
        Next
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 22:49:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5631997#M55837</guid>
      <dc:creator>fulvio81</dc:creator>
      <dc:date>2015-05-12T22:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5632489#M55838</link>
      <description>&lt;P&gt;Thanks you very much for your help.&amp;nbsp;&lt;IMG alt="Inventor_1.png" title="Inventor_1.png" src="https://forums.autodesk.com/t5/image/serverpage/image-id/168166i5620846CD33E7EA3/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;Now I have the itemnumber and the amount in the viewtitle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Toon&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 05:24:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5632489#M55838</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-13T05:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5648382#M56047</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi toolsol,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might want to consider an alternative method of getting the item number and quantity to show for a particular part. One downside to the method you are currently using is that if a component is assembled in more than one assembly (or is inside a subassembly that is reused), then the custom iproperty you've created for the quantity, is incorrect and misleading.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This video shows a more robust way of showing filtered information from the BOM in a parts list. You'll probably be interested in&amp;nbsp;&lt;SPAN style="line-height: 15px;"&gt;4 minutes 36 seconds onwards.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;&lt;A href="https://www.youtube.com/watch?t=277&amp;amp;v=qem8o-R2mqQ" target="_blank"&gt;https://www.youtube.com/watch?t=277&amp;amp;v=qem8o-R2mqQ&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The app shown on the video is on the Autodesk exchange apps website here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3aviewrephero_windows64%3aen" target="_blank"&gt;https://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3aviewrephero_windows64%3aen&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Luke&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2015 13:05:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/5648382#M56047</guid>
      <dc:creator>LukeDavenport</dc:creator>
      <dc:date>2015-05-22T13:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/8621880#M94962</link>
      <description>&lt;P&gt;How I wish that this would work for me!&amp;nbsp; This is to be run within an .IAM, right?&amp;nbsp; Are changes required for use in Inventor 2019? I am getting the following error:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P class="1551187673816"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="1551187673816"&gt;System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))&lt;BR /&gt;at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp;amp; msgData)&lt;BR /&gt;at Inventor.Property.set_Value(Object )&lt;BR /&gt;at ThisRule.RecursiveCheckAndSetProps(BOMRowsEnumerator oRowsElements)&lt;BR /&gt;at ThisRule.Main()&lt;BR /&gt;at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)&lt;BR /&gt;at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 26 Feb 2019 13:28:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/8621880#M94962</guid>
      <dc:creator>RogerTheShrubber</dc:creator>
      <dc:date>2019-02-26T13:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/8622408#M94973</link>
      <description>&lt;P&gt;Turns out that one of the parts is in a Read Only library location, causing the error.&lt;/P&gt;
&lt;P&gt;The code works beautifully. Thank you,&amp;nbsp;&lt;SPAN class="login-bold"&gt;&lt;A class="lia-link-navigation lia-page-link lia-user-name-link" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/681264" target="_self"&gt;fulvio81&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 16:47:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/8622408#M94973</guid>
      <dc:creator>RogerTheShrubber</dc:creator>
      <dc:date>2019-02-26T16:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/8848543#M98327</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;Hi!!&lt;/P&gt;
&lt;P&gt;The code is running well at some point, except these two points:&lt;/P&gt;
&lt;P&gt;An error arises and i think it's because of:&lt;/P&gt;
&lt;P&gt;1- I use a LOD iLogic&lt;/P&gt;
&lt;P&gt;2- I have library and content center parts&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The questions are:&lt;/P&gt;
&lt;P&gt;A) how can i avoid the error message?&lt;/P&gt;
&lt;P&gt;(I tried the " on error resume", but it's incompatible with the "try" statement).&lt;/P&gt;
&lt;P&gt;(Also tried the "if the part is modificable= true then", but i think this will not work for this case).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;B) The code will work for a LOD other than Master?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 00:52:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/8848543#M98327</guid>
      <dc:creator>CCarreiras</dc:creator>
      <dc:date>2019-06-13T00:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/8848551#M98329</link>
      <description>&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 00:58:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/8848551#M98329</guid>
      <dc:creator>CCarreiras</dc:creator>
      <dc:date>2019-06-13T00:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Structured Item numbers to a Iproperties field</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/8875799#M98823</link>
      <description>&lt;P&gt;Good morning everyone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking for something that look like this, but would love to have a ilogic code that make it the other way around.&lt;/P&gt;&lt;P&gt;For example.&lt;/P&gt;&lt;P&gt;I have a standard propertie, for example "Keywords" with the value "1" and use it as my value for the item number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could some one so nice and give me some help for that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 08:58:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-assign-structured-item-numbers-to-a-iproperties-field/m-p/8875799#M98823</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-27T08:58:51Z</dc:date>
    </item>
  </channel>
</rss>

