I have modeless dialog. On dialog I have button on which user clicks, when he wants to pick insertion point. Problem is when I exit dialog the command line is still in command GetPoint (doesn't show usual Command:). How can I solve this problem? My code at the moment is:
// this.Visible = false;
AppServ.Document adoc = AppServ.Application.DocumentManager.MdiActiveDocument;
AppServ.DocumentLock dl = adoc.LockDocument();
Editor ed = adoc.Editor;
using (ed.StartUserInteraction(this))
{
PromptPointOptions ppo = new PromptPointOptions("Pick Point:");
PromptPointResult respt = ed.GetPoint(ppo);
if (respt.Status == PromptStatus.OK)
{
//Do something
}
dwg.Dispose();
}
dl.Dispose();
// this.Visible = !this.Visible;
Hi carl,
Kan you tell me how you invoke your command to display the modeless form?
Are you using a commandmethod or are you invoking a method directly from your class???
When your invoking a method thats the problem. All commands need to be invoked trough a commandmethod attribbute.
Otherwise you will get this strange behavior of the command line.
kind regards,
irvin
Somehow like this:
public void dialog()
{
Dlg dlg = new Dlg();
dlg.Show(new WindowWrapper(AcadApp.MainWindow.Handle));
}
[CommandMethod("Test")]
static public void Test()
{
dialog();
}
Hi,
if I understand you right then invoking acedPostCommandPrompt will help, look >>>this<<<
HTH, - alfred -
Looking at the code you use when startting user interaction please look at this.
//Editor ed = AcadAppServ.Application.DocumentManager.MdiActiveDocument.Editor; using (AcadAppServ.DocumentLock docLock = AcadAppServ.Application.DocumentManager.MdiActiveDocument.LockDocument()) using( EditorUserInteraction edUsrInt = ed.StartUserInteraction(this)) { PromptPointOptions prPtOpts = new PromptPointOptions("\nPlease select a point to place the ellipse:"); PromptPointResult prPtRes = ed.GetPoint(prPtOpts); Utilities.AddEllipse(prPtRes.Value); prPtOpts.Message = "\nPlease select a point to place the circle:"; prPtRes = ed.GetPoint(prPtOpts); Utilities.AddCircle(prPtRes.Value); edUsrInt.End(); }
I think the problem is caused nod ending the userinteraction edUsrInt.End()
Irvin and Alfred, thanks for replies. At the moment I tried Alfreds suggestion and it works. Imported ObjectARX/LISP command "acedPostCommandPrompt()" does the trick. I will also try Irvins last suggestion if it works. Thanks again.
BTW, you have equivalent function in .NET
Autodesk.AutoCAD.Internal.Utils.PostCommandPrompt();