I'm currently working on a small tool that will let you mass copy files to multiple projects. I would like to narrow down the users selection options for destinations to just rich projects. Currently I'm using the "aaApi_SelectProjectDlg2" function with "AASPDLG_DMSVAULTSONLY | AASPDLG_RICHPROJECTS_ONLY" as flags. This works but takes roughly 2 minutes to load. I assume this is because of how it's filtering out all non rich projects.
ProjectWise Explorer Version 10.00.03.167
Thanks in advance!
Thank you for listing the version of ProjectWise that you are using as doing so is always helpful!
It is also helpful to list the version of the SDK, as it may not match, as well as the version of the server software. Code snippets can be very useful as well.
I'm using PWExplorer v10.00.03.280, PW SDK v10.00.03.049, and PW Integration Server v10.00.03.280 and another datasource on a server running v10.00.02.265.
Looking at the SDK documentation for the version I am using and AASPDLG_RICHPROJECTS_ONLY is not listed in the link to "Select Project Dialog Style Flags". However, as I teach in the SDK training class, sometimes the documentation is incomplete. It looks like you were aware of this and found that there are other flags. Searching the header and .fdf files is a way to discover these types of things. Searching for AASPDLG_RICHPROJECTS_ONLY, I found this:
It does say "without", but I suspect that this is a typo and should read "with", but that's just my interpretation because of the way the two flags are named!
I tried the following on a couple of test datasources, and performance seemed fine.
The 10.00.03.280 datasource had 11,402 folders, of which 705 are rich projects, and the other datasource had only 754 folders, of which 32 are rich projects. The smaller datasource responded very quickly, while the larger one took slightly longer, but appeared to be less than 2 seconds. It does appear that the number of folders makes a difference, and in my testing, using AASPDLG_RICHPROJECTS_ONLY did "filter" out folders that did not contain rich projects, so as you suggest, that may be a factor and most likely a WAD.
I tried using both flags, and that did seem to take a bit longer, but not much. On my larger datasource, it appeared to take slightly longer than 2 seconds.
Try your code again with only the AASPDLG_RICHPROJECTS_ONLY flag and see if that changes the performance that you are seeing.
If performance is still an issue, then you could obviously check to see if the selected folder is a rich project or not after the call returns and adjust your application's logic accordingly, i.e. remind the user that they must select a rich project, etc.
Dan WilliamsSolution ConsultantBentley Systems, IncorporatedPortland, OR, USA (Pacific Time UTC-08:00)
Answer Verified By: Geoffrey Samples
Thanks for your fast response! I'll remember to include my entire environments versions next time. Our datasourse is quite a bit larger than the first one you mentioned testing against. Even if I run it with only the "AASPDLG_RICHPROJECTS_ONLY" flag it still takes awhile. Something else that might be affecting this is that most of the users are running through a tunneled VPN. It seems that if I use "aaApiSelectProjectDlg()" the dialog will open instantly. I will probably have to use that one and force the user to pick rich projects. Again, thanks for the input!
You probably already thought of this, but in case you did not, but you could put the user back to the folder that they selected and that you rejected so that they don't have to remember where they were.
aaApiSelectProjectDlg will place the focus on the folder id that you pass in with the third parameter, "lProjectId", so if you reject it, you could let the user know via a dialog box or the status line of PWExplorer, and then call aaApiSelectProjectDlg with it defaulting to that last selected folder until they pick one that is a rich project (or click on the Cancel button).