@marco_bonacina5834P, I only had a quick look at this, so I might be off the mark, but a quick look at an iLogic rule I had for this shows a slightly different syntax for working from the BOM row see example.
Edit: I think I got confused in my quick look earlier, this is where I was seeing the difference, so I think this supports that you have the syntax correct.
apologies for any confusion
Dim oDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oBOM As BOM = oDoc.ComponentDefinition.BOM
Dim oBOMView As BOMView = oBOM.BOMViews.Item("Structured")
Dim oBOMRows As BOMRowsEnumerator = oBOMView.BOMRows
For i = 1 To oBOMRows.Count
Dim oRow As BOMRow = oBOMRows.Item(i)
Dim oCompDef As ComponentDefinition = oRow.ComponentDefinitions.Item(1)
If TypeOf oCompDef Is VirtualComponentDefinition Then
Dim oCustomPropertySet_Virt = oCompDef.PropertySets.Item("Inventor User Defined Properties")
Try
oProperty = oCustomPropertySet_Virt.Item("xxxx")
MsgBox(oProperty.value )
Catch
End Try
Else
Dim oCustomPropertySet = oCompDef.Document.PropertySets.Item("Inventor User Defined Properties")
Try
oProperty = oCustomPropertySet.Item("xxxx")
MsgBox(oProperty.value)
Catch
End Try
End If
Next
Dim oDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oBOM As BOM = oDoc.ComponentDefinition.BOM
Dim oBOMView As BOMView = oBOM.BOMViews.Item("Structured")
Dim oBOMRows As BOMRowsEnumerator = oBOMView.BOMRows
For i = 1 To oBOMRows.Count
Dim oRow As BOMRow = oBOMRows.Item(i)
Dim oCompDef As ComponentDefinition = oRow.ComponentDefinitions.Item(1)
Dim oCustomPropertySet = oCompDef.Document.PropertySets.Item("Inventor User Defined Properties")
Try
oProperty = oCustomPropertySet.Item("xxxx")
MsgBox(oProperty.value)
Catch
End Try
Next