Author Topic: Losing ProgressMeter  (Read 1912 times)

0 Members and 1 Guest are viewing this topic.

MexicanCustard

  • Swamp Rat
  • Posts: 705
Losing ProgressMeter
« 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?
Revit 2019, AMEP 2019 64bit Win 10

MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: Losing ProgressMeter
« Reply #1 on: November 18, 2011, 08:34:13 AM »
BUMP. No one else have this problem?
Revit 2019, AMEP 2019 64bit Win 10

Dashmonkey

  • Newt
  • Posts: 29
  • (defun sleep nil nil)
Re: Losing ProgressMeter
« Reply #2 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?
I didn't break it, I swear! ...ok, I broke it.

MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: Losing ProgressMeter
« Reply #3 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.
Revit 2019, AMEP 2019 64bit Win 10

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Losing ProgressMeter
« Reply #4 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
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.