I’m trying to detect when the user selects and deletes a block instance from a drawing. The problem is that, when you select a line in a block, the selected object is a SketchSegment and not a block instance. So I am now trying to find which block instance that sketch segment belongs to.
But SketchBlockInstance seemingly has no way of getting the lines in that block:
https://help.solidworks.com/2021/English/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.ISketchBlockInstance_members.html
I’ve tried getting the sketch that contains the sketch segment, which returns the sketch of the view that the block instance is in. Each view has a sketch that can contain blocks and other sketch segments. If that view contains two identical block instances, you don’t know which one is selected.
Any ideas?