"TraverseNode" is a function that successfully creates a collection of all the feature nodes.
I wrote the following code that is able to find the feature in the feature/node tree. It properly gets the name, type, and ID, but I doesn't successfully delete them. I think that my selection method has a problem.
Thank you for your help.
Code: Select all
TraverseNode swRootNode, swFeatsColl
For i = 1 To swFeatsColl.Count
Set swFeat = swFeatsColl.Item(i)
FeatName = swFeat.Name
FeatType = swFeat.GetTypeName2()
FeatID = swFeat.GetID
Debug.Print i & " " & "Name: " & FeatName & " " & "Type: " & FeatType & " " & "ID: " & FeatID
If swFeat.GetTypeName2() = "EditBorderFeature" Then
FeatName = swFeat.Name
FeatType = swFeat.GetTypeName2()
FeatID = swFeat.GetID
Debug.Print i & " " & "Name: " & FeatName & " " & "Type: " & FeatType & " " & "ID: " & FeatID
swModel.ClearSelection
BoolStatus = swModel.Extension.SelectByID2(FeatName, FeatType, 0, 0, 0, False, 0, Nothing, 0)
Debug.Print "SelectByID2: " & BoolStatus 'Returns FALSE !?!?!
swModel.EditDelete
Debug.Print "EditDelete: " & BoolStatus 'Returns FALSE !?!?!
Exit Sub
End If
Next