Message 1 of 3
Get partnumbers of purchased parts, excluding pp in purchased assy's
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I'm working on an iLogic rule which will export certain part numbers to a txt-file. I want to export all part numbers of parts and sub assemblies that are set as purchased. Sometimes a purchased subassy contains some purchased parts, but i don't need the part numbers of those parts.
So basically i need an export of all the partnumbers that would show op as purchased in the parts-only BOM.
The rule is mostly working, but the part that should skip purchased parts in purchased assy's seems to be causing problems. So I was wondering if there is a better/alternative way to write this:
If oRefDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Or oRefDoc.SubType = "{4D29B490-49B2-11D0-93C3-7E0706000000}" Or oRefDoc.SubType = "{E60F81E1-49B3-11D0-93C3-7E0706000000}" Or oRefDoc.SubType = "{28EC8354-9024-440F-A8A2-0E0E55D635B0}" Then Dim oPartDoc As Document oPartDoc = oRefDoc 'Check if part is purchased part If oPartDoc.ComponentDefinition.BOMStructure = 51973 Then 'Purchase Dim oRefAssys As DocumentsEnumerator = oRefDoc.ReferencingDocuments Dim PurchaseCheck As Document Dim ReffPurchasePart As Boolean ReffPurchasePart = True 'Check if there are purchased parts in purchased assy's, if so then ignore these parts For Each PurchaseCheck In oRefAssys 'purchase 'assembly If PurchaseCheck.ComponentDefinition.BOMStructure = 51973 And PurchaseCheck.SubType = "{E60F81E1-49B3-11D0-93C3-7E0706000000}" Then ReffPurchasePart = False End If 'weldment If PurchaseCheck.ComponentDefinition.BOMStructure = 51973 And PurchaseCheck.SubType = "{28EC8354-9024-440F-A8A2-0E0E55D635B0}" Then ReffPurchasePart = False End If Next If ReffPurchasePart = False Then Else