Editor is IsQuiescent

Editor is IsQuiescent

BestFriendCZ
Advocate Advocate
1,519 Views
5 Replies
Message 1 of 6

Editor is IsQuiescent

BestFriendCZ
Advocate
Advocate

Hi all,

 

i have problem with this property. i have simple Add-In which process CAD drawings in thread.

1) Add-In starts FORM where user choose operations, file and etc

2)My problem is.... that if i start form this property will get immediately to TRUE and it is only GET type.

Any advice?

(ShowDialog isn’t solution for me)

 

       [CommandMethod("TEST")]
        public static void ProcessData()
        {
            TestForm form = new TestForm();
            form.Show();
            //form.ShowDialog();
        }

 

...
0 Likes
Accepted solutions (1)
1,520 Views
5 Replies
Replies (5)
Message 2 of 6

Norman_Yuan
Mentor
Mentor

@BestFriendCZ wrote:

... 

2)My problem is.... that if i start form this property will get immediately to TRUE and ...


If IsQuiecent is True after the form shows, so what? You should provide more information on what the form does after it shows: waiting for user to interact with it, or automatically does something? Why does IsQuiescent=true bother you?

 

You should NEVER use Form.Show()/ShowDialog(). Instead, you use Application.ShowModal[/Modeless]Dialog().

 

Using modeless dialog is quite tricky, depending on the role of the modeless dialog plays in your app's process. Your mention of "process CAD drawings in thread" raises a red flag: something could be done improperly. But that is purely speculation without knowing more information on what you are trying to do.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 6

BestFriendCZ
Advocate
Advocate

Hi,

thanks for your feedback. If you open brand new Form any way (Application.ShowModelessDialog (form) / Application.Show (form)) and push button where is simply code:

Document doc =Application.DocumentManager.MdiActiveDocument;

that editor is Quiescent and when I use editor.command I will receive einvalidinput error

 

in case

Application. ShowModalDialog (form) / Application.Dialog (form)

 

Function which i call in editor context does not happen immediately and it is problem to me. Doesn't matter if it is on thread or not.

...
0 Likes
Message 4 of 6

Norman_Yuan
Mentor
Mentor
Accepted solution

Editor.Command() CAN ONLY be used in Document context. You cannot call it from an event handler (such as button's click event handler) of a modeless form. It has nothing to do with Editor.IsQuiescent property. Using modeless form/window is very tricky/advanced topic in terms of AutoCAD .NET API.

 

A recent discussion might give you some clues on how to use it:

https://forums.autodesk.com/t5/net/wpf-window-and-autocad-not-working-synchronously/td-p/10128980 

 

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 5 of 6

BestFriendCZ
Advocate
Advocate
Hi,
Thank you for information. Your sample “Modeless Form/Window - Do Something And Update Its View” is answer on my question. I have to rewrite code.
...
0 Likes
Message 6 of 6

BestFriendCZ
Advocate
Advocate

Hi,

Thank you for information. Your sample “Modeless Form/Window - Do Something And Update Its View” is answer on my question. I have to rewrite code.

...
0 Likes