In my attached example, I have two drawing sheets each with a BOM. I want to program a macro to delete only the BOM on the second drawing sheet. I already know how to select a BOM and delete it, but no idea how to know which drawing sheet it is referenced to.
Is there a method I can use to determine which BomFeat is on the second drawing sheet?
I use the code below to delete all BOMs.
SolidworksApi macros'***Traverse the Feature tree to find the BOM Features, if it is a BOM feature, then delete
Dim FeatureObj As SldWorks.Feature
Set FeatureObj = ModelDocObj.FirstFeature
Do While Not FeatureObj Is Nothing
'Debug.Print FeatureObj.GetTypeName
If FeatureObj.GetTypeName = "BomFeat" Then
FeatureObj.Select (True)
ModelDocObj.EditDelete
Set FeatureObj = ModelDocObj.FirstFeature
End If
Set FeatureObj = FeatureObj.GetNextFeature()
Loop
