Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise Design Integration Forum Default File extension mode for open file dialog in projectwise based microstation
    • Sign In

    • Replies 8 replies
    • Subscribers 62 subscribers
    • Views 7095 views
    • Users 0 members are here

    Default File extension mode for open file dialog in projectwise based microstation

    gwave77
    gwave77 over 10 years ago

    Hello,

    I was wondering if there was a way to change the default extensionm mode from "*.dgn,*.dwg, *.dxf" to "all documents" for the projectwise based microstation file open dialog window.

     

    thanks

     

    Tom

     

     

    • Sign in to reply
    • Cancel
    Parents
    • Bert Fegyverneki
      Offline Bert Fegyverneki Thu, Jul 11 2013 6:40 PM

      Hi Tom,

      I am currently using PW SS2....

      Using the ProjectWise Administrator, you can add/modify/remove the "File Extensions" that are opened with MicroStation.

      In PWA, mouse click on the "Applications" branch on the tree for your datasource.

      Look for the MicroStation name,  mouse click it and use the right mouse button to select "Properties".

      This opens a dialogdisplaying the currently set file extensions set to open with MicroStation...you can add the "sht" extension and it will allow MS to open the file extension when selected from PW Explorer.

      However, I was unable to find a setting to allow the display of "All Documents" in the Document List of the Document Open dialog.

      Perhaps this has been addressed in a newer version of PW....

      Regards,

      Bert

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Cancel
    • Michael McCarty
      Michael McCarty Fri, Jul 12 2013 1:50 AM in reply to Bert Fegyverneki

      I haven't tried this, just took a quick look at the code, but you might investigate this:

      Create a customization that hooks AAHOOK_OPEN_DOCUMENTS_DLG2 using AAOPER_DLG_DOCOPEN, and set the hook param object's lFilterIndex member to the index value of the "All Documents" string.  I don't quite have the time to dig into this, but a little experimentation might get you where you need to go.

      HTH

      Mike



      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Cancel
    • mike.lazear
      Offline mike.lazear Thu, Dec 19 2013 1:42 PM in reply to Michael McCarty

      Michael I have a customer who wants to do almost the exact same thing.  The only difference is he would like to tweak the filter "*.dgn,*.dwg, *.dxf" and add *.sht so his would look like:  "*.dgn,*.dwg, *.dxf, *.sht".  

      Two questions:

      Do you think that it is possible to add the extra extension?  

      There are lots of sample ProjectWise SDK apps for tweaking ProjectWise Explorer.  Is there a sample app for modifying the MicroStation/PW connection?  

      We've added the .sht extension in ProjectWise Administrator but that doesn't affect the extensions that show in the MicroStation (PW style) Open dialog.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Cancel
    • Michael McCarty
      Michael McCarty Mon, Dec 30 2013 10:08 AM in reply to mike.lazear

      Hi Mike,

      Yes, you can override this filter string value, but it's a bit tricky.

      First, ensure that the AAOPENDLG2_MASK_FILEEXTFILTER is set in the hook param structure's ulMask member

      Next, you'll need to manually append (or insert) your new filter selection into the existing filter string.  Note that this string is a sequence of filter values, separated by NULL character values (i.e. '\0'), and ultimately terminated by a sequence of two NULL character values.   So, if you want to simply append a new filter value, you'll need to:

      - Copy the existing filter string value.  This is important, because the string buffer passed in the original filter string will not have enough capacity to store to store your added values.  It's not really important how you allocate this buffer, except that this buffer must be valid after the hook function returns (i.e., use a static or heap allocated buffer - no stack allocations!)

      - Parse the existing filter string until you find two NULL character values, walk back one character, insert your new value, and append two NULL characters to the end. (See the documentation of the AAOPENDOCSDLG2_PARAM::lpctstrFilter structure member.)

      Again, not tested, but this should work.  YMMV.

      HTH

      Mike



      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Cancel
    • mike.lazear
      Offline mike.lazear Thu, Jan 30 2014 6:38 PM in reply to Michael McCarty

      Hi Mike,

      I'm trying to implement your suggestion.

      I've created a hook:

      aaApi_AddHook (AAHOOK_OPEN_DOCUMENTS_DLG2, AAACTIONHOOK, Hook_OpenDlg)

      I launch MicroStation (VS launches as Debug app) and with a break point on Hook_OpenDlg I do get called prior to the PW open dialog showing in MicroStation.

      So far so good.  I can set the ulMask to include AAOPENDLG2_MASK_FILEEXTFILTER but then I'm not sure how I would get my hook to fire again so I can see the value of AAOPENDOCSDLG2_PARAM::lpctstrFilter.

      My hook above is an Action Hook.  Should I have a Prehook that sets the ulMask so that when by Hook_OpenDlg fires it will have the default value of lpctstrFilter that I can then modify?  (Taking into account the allocation of a new buffer since I'm increasing the size).

      I'm just not sure when to set ulMask.

      Any suggestions would be appreciated.

      Thanks,

      Mike

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Cancel
    • CAD Admin
      Offline CAD Admin Mon, Jan 12 2015 5:18 PM in reply to mike.lazear
      Hello Mike's

      Did you get it to work, we would like to know if this is a workable solution.

      Thanks
      Raj
      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Cancel
    • Brian Johnson
      Offline Brian Johnson Tue, Mar 23 2021 8:54 AM in reply to CAD Admin

      Raj or Mike,

      I'm curious to know if you ever found a solution for this. having to switch the extension everytime I go to open a sht file is driving me crazy. Thanks!

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Cancel
    Reply
    • Brian Johnson
      Offline Brian Johnson Tue, Mar 23 2021 8:54 AM in reply to CAD Admin

      Raj or Mike,

      I'm curious to know if you ever found a solution for this. having to switch the extension everytime I go to open a sht file is driving me crazy. Thanks!

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Cancel
    Children
    • mike.lazear
      Offline mike.lazear Sat, Mar 27 2021 10:13 PM in reply to Brian Johnson

      That was 7 years ago for a client I was doing work for at the time.  I don't believe I ever got a response to the question about ulMask and I believe I stopped pursuing an answer.  Sorry.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Cancel

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies