Author Topic: OpenFileDialog, Windows vs AutoCads  (Read 4743 times)

0 Members and 1 Guest are viewing this topic.

T.Willey

  • Needs a day job
  • Posts: 5251
OpenFileDialog, Windows vs AutoCads
« on: March 28, 2008, 02:50:31 AM »
I had to batch a whole bunch of drawings today.  My code uses the Acad OpenFileDialog.  I had to batch ~800, and it took longer than 15 min.s to select the drawings, so I changed it to use the Windows one, and I could select them all in less than 5 seconds.

So my question is there any reason why one should use the Acad on vs the Windows one?  And if it is better to use the Acad one; is there a way I can speed it up?  Thanks in advance.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: OpenFileDialog, Windows vs AutoCads
« Reply #1 on: September 11, 2008, 12:35:39 PM »
I have come to the conclusion that I like the Windows version better as it runs a whole lot faster.  The only problem I had was that I customized the Acad one to have my most common folders in it, and I didn't like the fact that the Windows one didn't.  I have just found this page that showed me how to customize the Windows one, and I'm a happy camper now.  It shows how to do it in code, but I haven't messed with the registry with code yet, so I just hard coded it for now.  Just and FYI for all.

[ http://msdn.microsoft.com/en-us/magazine/cc300434.aspx ]
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

FengK

  • Guest
Re: OpenFileDialog, Windows vs AutoCads
« Reply #2 on: September 11, 2008, 01:51:30 PM »
I have just found this page that showed me how to customize the Windows one, and I'm a happy camper now.  It shows how to do it in code, but I haven't messed with the registry with code yet, so I just hard coded it for now.  Just and FYI for all.

Tim, I did that on my windows open file dialog before and remembered there can be only no more than five folders. Is that the case? (You can put many folders in the ACAD open file dialog.)

--
Kelie

T.Willey

  • Needs a day job
  • Posts: 5251
Re: OpenFileDialog, Windows vs AutoCads
« Reply #3 on: September 11, 2008, 02:21:52 PM »
I have just found this page that showed me how to customize the Windows one, and I'm a happy camper now.  It shows how to do it in code, but I haven't messed with the registry with code yet, so I just hard coded it for now.  Just and FYI for all.

Tim, I did that on my windows open file dialog before and remembered there can be only no more than five folders. Is that the case? (You can put many folders in the ACAD open file dialog.)

--
Kelie
Yes, it is still limited by that Kelie.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Glenn R

  • Guest
Re: OpenFileDialog, Windows vs AutoCads
« Reply #4 on: September 11, 2008, 04:10:20 PM »
Tim,

Were these 800 odd files you mentioned in one folder or interspersed across multiple folders?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: OpenFileDialog, Windows vs AutoCads
« Reply #5 on: September 11, 2008, 04:50:47 PM »
Tim,

Were these 800 odd files you mentioned in one folder or interspersed across multiple folders?
One folder.  I have two projects that I have right now that have more than 600 files each.  It was just a bear to print them with my batch plot routine, or to update the title blocks, but with the Windows dialog box, it doesn't take any time at all to select them.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Glenn R

  • Guest
Re: OpenFileDialog, Windows vs AutoCads
« Reply #6 on: September 11, 2008, 05:06:48 PM »
I prefer to use the Acad dialog, as that gives the user all the functionality they are accustomed to.

If you need to select multiple files and by that I mean a shed-load, then have a looky at the code I posted here.

By allowing a FOLDER pick, rather than selecting a mass of indivual files you can then control the UI updates (BeginUpdate/EndUpdate) givng the illusion of good perfomance and you get the best of both worlds.
It reminds me of the old saying...'It's easier to destroy than it is to create'.

In this context, it's easier to pick a shed-load of files via folder pick, then have the user knock out the relatively few he doesn't need in this batch run, than make them pick using CTRL + SHIFT modifiers in the dialog which is slow...make sense?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: OpenFileDialog, Windows vs AutoCads
« Reply #7 on: September 11, 2008, 05:19:47 PM »
Thanks Glenn.  I'll look more into it when I get a minute.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: OpenFileDialog, Windows vs AutoCads
« Reply #8 on: September 12, 2008, 12:50:33 PM »
Glenn,

  I like the idea of the ability to select the style for when you are selecting drawings.  I have even put it in my batch plot routine. Thanks!

I noticed one thing though that didn't need to be there.
In this snippet, the check for true is redundant.
Code: [Select]
dlg.Description = (radioButtonFolder.Checked ==
    true ? "Select folder to search:" : "Select folder to recursively search:");
It could just be
Code: [Select]
dlg.Description = (radioButtonFolder.Checked ? "Select folder to search:" : "Select folder to recursively search:");
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Glenn R

  • Guest
Re: OpenFileDialog, Windows vs AutoCads
« Reply #9 on: September 12, 2008, 12:55:32 PM »
Tim,

True - don't know what I was on when I scribbled that line out.

Glenn R

  • Guest
Re: OpenFileDialog, Windows vs AutoCads
« Reply #10 on: September 12, 2008, 12:56:04 PM »
verbose = true; :D

T.Willey

  • Needs a day job
  • Posts: 5251
Re: OpenFileDialog, Windows vs AutoCads
« Reply #11 on: September 12, 2008, 01:02:16 PM »
verbose = true; :D
Since I finally got a chance to look at it today, we shall say it was a Friday when you wrote it also... works for me.  :wink:
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Glenn R

  • Guest
Re: OpenFileDialog, Windows vs AutoCads
« Reply #12 on: September 12, 2008, 04:51:17 PM »
I prefer to think that it was IntelliSenseless that made me do it ;)