Export to Excel BOM Virtual Parts

Export to Excel BOM Virtual Parts

marco_bonacina5834P
Enthusiast Enthusiast
137 Views
1 Reply
Message 1 of 2

Export to Excel BOM Virtual Parts

marco_bonacina5834P
Enthusiast
Enthusiast

Hello everyone,
I have a problem with the export of virtual components present in the BOM, I used this rule that in iLogic works correctly while in Visual studio it does not generate any row in the excel sheet.

		For Each oRow As BOMRow In oBomRows
			Dim oPropSets As PropertySets
			oPropSets = oCompDef.Document.PropertySets
			Dim oDesignTrackingPropertySet = oPropSets.Item("Design Tracking Properties")
			If TypeOf oRow.ComponentDefinitions.Item(1) Is VirtualComponentDefinition Then
				ESBomRow.iPartNumber = oRow.ComponentDefinitions.Item(1).PropertySets("Design Tracking Properties")("Part Number").Value
				ESBomRow.iStockNumber = oRow.ComponentDefinitions.Item(1).PropertySets("Design Tracking Properties")("Stock Number").Value
				ESBomRow.iDescription = oRow.ComponentDefinitions.Item(1).PropertySets("Design Tracking Properties")("Description").Value
			Else
				ESBomRow.iPartNumber = oDesignTrackingPropertySet.Item("Part Number").Value
				ESBomRow.iStockNumber = oDesignTrackingPropertySet.Item("Stock Number").Value
				ESBomRow.iDescription = oDesignTrackingPropertySet.Item("Description").Value
			End If
Next

The virtual parts can be both in the main assembly and in the subassemblies.

 

Thanks.

0 Likes
Accepted solutions (1)
138 Views
1 Reply
Reply (1)
Message 2 of 2

marco_bonacina5834P
Enthusiast
Enthusiast
Accepted solution

I solved it, it was enough to insert .item in front of the property type and property name like this:

ESBomRow.iPartNumber = oRow.ComponentDefinitions.Item(1).PropertySets.Item("Design Tracking Properties").Item("Part Number").Value
0 Likes