Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Thanks WCrihfield, I'll check it out right away.
What are your thoughts on retrieving Parent document and Parent document BomStructure from the BOMView?
What do you think is the best method?

This is what I used now but I'm wondering if there is any better.

For Each oBOMRow In oBOMRows
    ' Let's only get the first definition
    ' It would only be more than one if rows were merged
    Dim oDef As ComponentDefinition
    oDef = oBOMRow.ComponentDefinitions(1)
			
	Dim partNumber As String
	    partNumber = oDef.Document.PropertySets("{32853F0F-3444-11D1-9E93-0060B03C1CA6}")("Part Number").value
		Dim oDoc As Document = oBOMRow.ComponentDefinitions.Item(1).Document	
	
		Dim Parent As Document = oDoc.ReferencingDocuments.Item(1)
		Dim oParentDocFile As Document
		oParentDocFile = Parent	
		BOM_Parent = GetBOMStructure(oParentDocFile.ComponentDefinition.BOMStructure)
	 	 
	 'If GetBOMStructure(oBOMRow.BOMStructure) Like filter Or GetProp(oDoc, "IUDP", "Fabrication") Like "*W*" Then
	 'If GetProp(oDoc, "IUDP", "Fabrication") Like "*W*" Then
	 If oBOMRow.ComponentDefinitions.Item(1).Document.FullFileName Like "**" Then	
		


One more question, if I want to show all the properties but some don't exist, is there a standard way to have it so no error message or should I make a Sub with a Try Catch in it?

I don't like a whole pile of try catches
And what is the best method to retrieve them, is there a right or wrong, is one more stable than the other?

With a separate sub I can show when the code has no value.