Hi Guys,
I have a strange situation.
I am using Application.ShowModelessDislog to bring up a .NET DLL app inside AutoCAD.
In principal:
I get Data from a SQL source which wfills combo boxs
Then I press a button
and the Dislog Code Compares the Objects in my model (using a 3rd Party API)
Hides all parts that a correct and leaves behind incorrect.
If I use Application.ShowModalDialog everything works fine
but
If I use Application.ShowModelessDialog I get error during the processing.
Error: .... has a command in progress. Hit enter to cancel or retry.
Any idea what is going on
Stephan
In general, modal dialog box is used in the context of a single document (MdiActiveDocument, usually), while modelesss dialog box is used in the application context and one needs to be handle the events when current document is chnaged (thus the document specific information shown in the modeless form also has to be changed, or the form has to be closed, in order to not confuse the users).
From your very brief description, it sounds like you need to lock the document if the coded action in the button-click handler needs to access the drawing database. Spmethign like:
private void MyButton_Click(...)
{
Document dwg=......MdiActiveDocument;
using (DocumentLock lck=dwg.LockDocument())
{
DoTheWorkToDocument(dwg);
}
}
Norman Yuan
I will attempt to try this again but previsouly when I tried this, it made no difference.
I appricate the reply.
Stephan