- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a custom palette that has a bunch of blocks on it, when the user selects a block it prompts for a point using doc.Editor.GetPoint and loops through so that they can keep clicking and inserting the same block in different places. The issue I have is that this prompt doesn't seem to be considered a command, so doc.CommandInProgress returns "" when it is running through the loop.
I want the current command/prompt to cancel when the user clicks on the different block, and then continue looping through the new block for insertion points.
I have tried the following, but since autocad doesn't consider the prompt a command, the CommandCancelled event is never called.
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
doc.CommandCancelled += new CommandEventHandler(Document_CommandCancelled);
doc.SendStringToExecute("\x03\x03", false, true, false);
Is there a way I can either cancel all current prompts / or have the CommandCancelled even called when it is one of my prompt being run? Or another way to cancel all commands / prompts and wait until complete before continuing with the code (other options I've tried haven't worked and I can't find a solution).
Thanks,
Solved! Go to Solution.