0

I wan to write a code to select parent item in catia. I select a object then run this code.

Set Sel = CATIA.ActiveDocument.Selection
Sel.Add Sel.Item(1).LeafProduct.Parent.Parent

then 2 item selected: item(1),item(2). How to subtract item(1)? Thanks

Yume
  • 11
  • 4
  • 1
    What do you mean by _subtract item_? Do you want to subtract bodies from different parts with Boolean operation? – Shrotter Mar 24 '22 at 08:06
  • like i selected 2 part in assembly. Now i need unselect item(1) . How can i do this with VBA? – Yume Mar 24 '22 at 14:25
  • I'm still not sure what you mean. With `Sel.Remove2(i)` you can remove the _i-th_ item. Or do you want to invert the selection? – Shrotter Mar 24 '22 at 15:30
  • yeah, it worked. that's exactly what i want. It's so simple but I can't find it anywhere. Thank you so much. – Yume Mar 25 '22 at 00:42
  • You find these methods/objects in the documentation: _V5Automation.chm_ in the catia install directory – Shrotter Mar 25 '22 at 07:13

0 Answers0