Author Topic: Getting User Input error after showing a paletteset  (Read 1453 times)

0 Members and 1 Guest are viewing this topic.

cincir

  • Guest
Getting User Input error after showing a paletteset
« on: August 12, 2011, 05:05:24 PM »
Hello everyone,

I have got a problem about getting user input.

In a function i am first getting a selection from the user by editor.getselection(...)

then i show a paletteset with my usercontrol in the same function. everything is fine so far.

but after showing paletteset i try to get a string from the user by editor.getstring(...) in the same function but statement continues as i never request it. when i check the PromptResult status it is equal to cancel.

i mean

            Transaction acTrans = null;

            Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Database acCurDb = acDoc.Database;

            acDocLock = acDoc.LockDocument();
            using (acDocLock)
            {
                PromptSelectionOptions acOPrompt = new PromptSelectionOptions();
                acOPrompt.MessageForAdding = "Select objects";
                PromptSelectionResult acSPrompt = acDoc.Editor.GetSelection(acOPrompt);

                if (acSPrompt.Status == PromptStatus.OK)
                {
                    acTrans = acCurDb.TransactionManager.StartTransaction();
                    try
                    {
                        // Process selected objects

                            ShowPalette(true);

                            PromptStringOptions pso = new PromptStringOptions("Enter name for selection");
                            pso.AllowSpaces = true;

                            PromptResult pr;

                            do
                            {
                                pr = acDoc.Editor.GetString(pso); //--------->never stop there if showpalette is executed.
                            } while (pr.Status == PromptStatus.OK);

i tried to lock the document but it doesnt work either. when i comment out "showpalette(true)" it works correctly.

can anyone help me about this problem.

thanks in advance.

Jeff H

  • Needs a day job
  • Posts: 6151
Re: Getting User Input error after showing a paletteset
« Reply #1 on: August 12, 2011, 05:12:51 PM »
Welcome to the Swamp!!!!!!

Maybe?
 
Code: [Select]

                 ShowPalette(true);
                PromptStringOptions pso = new PromptStringOptions("Enter name for selection");
                pso.AllowSpaces = true;
                PromptResult pr;
                ////////////////////////////////////////////////////////////////////////////////
                Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView();///////////////------add this
                ////////////////////////////////////////////////////////////////////////////////
                do
                {
                    pr = acDoc.Editor.GetString(pso); //--------->never stop there if showpalette is executed.
                } while (pr.Status == PromptStatus.OK);ptStatus.O
« Last Edit: August 12, 2011, 05:19:28 PM by Jeff H »

cincir

  • Guest
Re: Getting User Input error after showing a paletteset
« Reply #2 on: August 12, 2011, 05:27:33 PM »
Thank you Jeff for your answer but unfortunatelly it did not work.

i realized that if my document window s state is not WindowState.Maximized then my code works just fine but if it is WindowState.Maximized it does not work. it may be a clue.

Artvegas

  • Guest
Re: Getting User Input error after showing a paletteset
« Reply #3 on: September 28, 2011, 06:05:50 AM »
Did you see my answer to you post in the Autodesk Discussion Groups?:

http://forums.autodesk.com/t5/NET/Getting-User-Input-error-after-showing-a-paletteset/td-p/3123308

Art