When I manually search & select and delete an object, catia shows a "Delete" dialog box where I can select "Delete all exclusive parents" & "Delete all children". When I carry out the same process using the following code, "Delete" dialog box does not show up and I cannot toggle on "delete all Children" to successfully delete the object. How do I let catia show "Delete" dialog box when I run the following code? or is it possible to incorporate a line where I can delete the children too?
Dim productDocument1 As ProductDocument = _CATIA.ActiveDocument
Dim oSelection As Selection = productDocument1.Selection
oSelection.Search("Name= *Object*,All")
If oSelection.Count2 > 0 Then oSelection.Delete()
After selecting the items to delete, instead of oSelection.Delete() you can do
_CATIA.StartCommand("Delete")
and you should be shown the dialog to interact with.
If you want to automatically handle the dialog, then you will have to use WINAPI methods.