Yes.
But unless you want to iterate though EVERY FILE on your file system, you need to think up of some sort of search algorithm
If your part number is also used in the drawing name, you could easily open an assembly of parts and run a rule for all of the parts in it.
Also, by suggesting you want it to go through the partslist specifically, you are implying a solution for your problem which actually might have a better solution. Think carefully about how you describe your problem/needs for the solution and try to not imply solutions as it makes things more difficult for everyone.
In this case, the more efficient route is to just iterate through the AllReferencedDocuments container instead of having to access the BOM object and recursively iterate through the BOM rows...
Dim oAsmDoc As Document
oAsmDoc = ThisDoc.Document
For Each oSubDoc in oAsmDoc.AllReferencedDocuments
'oDrawingPath = System.IO.Path.GetDirectoryName(oSubDoc.FullFileName)
'oDrawingName = System.IO.Path.GetBaseName(oSubDoc.FullFileName)
oDrawingName = LEFT(oSubDoc.FullFileName, LEN(oSubDoc.FullFileName) - 4) & ".idw"
If System.IO.File.Exists(oDrawingName) = True Then
iProperties.Value(System.IO.Path.GetFileName(oSubDoc.FullFileName), "Custom", "HasDrawing") = True
Else
iProperties.Value(System.IO.Path.GetFileName(oSubDoc.FullFileName), "Custom", "HasDrawing") = False
End if
Next
--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.