TheSwamp

Code Red => .NET => Topic started by: MexicanCustard on November 16, 2011, 01:54:32 PM

Title: Losing ProgressMeter
Post by: MexicanCustard on November 16, 2011, 01:54:32 PM
I've got a long operation where I'm creating new DWG files, adding Xrefs, and saving them.  Whenever Database.SaveAs() executes it removes the ProgressMeter from the taskbar. So my users cant see it until the operation is complete.

example:
Code: [Select]
ProgressMeter pmeter = new ProgressMeter();
pmeter.SetLimit(floors.Count);
pmeter.Start();

foreach ( floor in floors)
{
    Database newDB = Database(false, false);
    newDB.ReadDwgFile("acad.dwt", FileShare.ReadWrite, false, null);
    //add some xrefs
    newDB.SaveAs("New Project.dwg", false, DwgVersion.Current, null); <--- Meter disappears here;
    pmeter.MeterProgress();
    System.Windows,Forms.Application.DoEvents();
}

pmeter.Stop();

Anybody know how to make it stop disappearing or bring it back?
Title: Re: Losing ProgressMeter
Post by: MexicanCustard on November 18, 2011, 08:34:13 AM
BUMP. No one else have this problem?
Title: Re: Losing ProgressMeter
Post by: Dashmonkey on November 18, 2011, 12:14:59 PM
Noob response:
When you normally do a Save As is your drawing, AutoCAD displays a progress meter. Could it be that this progress meter is conflicting with the one you're trying to display?
Title: Re: Losing ProgressMeter
Post by: MexicanCustard on November 21, 2011, 07:46:04 AM
DashMonkey, thats exactly whats happening. Sorry for not updating this info. I had asked Kean that exact question and he didnt know of anyway to stop the default behavior from overwriting my meter and then turning it off.

I guess I'll have to create a dialog with a progress meter in it and forego the built in one.
Title: Re: Losing ProgressMeter
Post by: Kerry on November 21, 2011, 08:00:39 AM

MexicanCustard,
Good fortune with a solution.

Please post back and let us know how you get along.

Regards