I am trying to delete sketches from an assembly. I found the assembly sketches that I want to delete in SolidEdgeAssembly.ComponentLayouts (using Solid Edge Spy), but my code doesn’t work for deleting the sketches.
The error message I get is : “Unable to cast COM object of type ‘System._ComObject’ to interface type ‘SolidEdgeAssembly.ComponentLayout’. This operation failed because the QueryInterface call on the COM component for the interface with IID…”
Anybody know how to do this? My code is the following: