I am using ISketchRelation::ReplaceEntity, but after it's used, there is a green check box in the top right hand corner. It appears that when I execute this command, even when done successfully, it never fully leaves the command.
for now, I use the following code, but it's not a solution it's a work-around:
bool running =
app.IsCommandEnabled(
(int)SolidWorks.Interop.swcommands.swCommands_e.swCommands_ReplaceEntity);
if (running) {
SketchPoint skPt = skMgr.CreatePoint(0, 0, 0);
skPt.Select4(false, null);
model1.EditDelete();
}
I searched all over, and cannot find a way to stop a running command detected by ISldWorks::IsCommandEnabled. It appears that this is a bug with ISketchRelation::ReplaceEntity, but I would think there would be a way to programmatically leave an active command, like in this scenario.
I also prefer not to exit the sketch, to only go ack into it to finish my processing. This just seems sloppy.
Is there a way to stop a running SolidWorks command, or is executing a different command the only solution?
SolidworksApi/macros