0

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()
djv
  • 15,168
  • 7
  • 48
  • 72

1 Answers1

0

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.

C R Johnson
  • 964
  • 1
  • 5
  • 12
  • Thank you. I'm trying to use _CATIA.StartCommand("Update All"), but it pulls up update analysis. Where can I find the list of commands. thanks again. – Kannan Rajan Feb 10 '20 at 22:21