Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Export-PWDocuments Relative Path For References
    • Sign In

    • State Verified Answer
    • Replies 6 replies
    • Subscribers 65 subscribers
    • Views 556 views
    • Users 0 members are here
    • Export
    • PWPS
    • pwps_dab
    • references
    • Export-PWDocuments

    Export-PWDocuments Relative Path For References

    Trevor Sedlock
    Offline Trevor Sedlock 6 months ago

    When attempting to export documents from ProjectWise using the Powershell command Export-PWDocuments, the references are using DMS paths still instead of relative paths based on the export location. When performing the same action using the Export Folders tool inside of ProjectWise Explorer, there's an option called "Update documents to use local paths for references and links" that works and changes the reference paths. How can this be done using the Powershell commands?

    Examples of script we've used:

    <#Delcare Vars#>
    $LocalFolder = 'D:\_idcWork\pwArchiveStructure\BAM Training 2'
    $PWFolderPath = '\Training\BAM Training'
    
    <#Export Docs#>
    Export-PWDocuments -InputDocuments (Get-PWDocumentsBySearch -FolderPath "$PWFolderPath") -OutputFolder "$LocalFolder" -Verbose
    
    Export-PWDocuments -OutputFolder "$LocalFolder" -ProjectWiseFolder "$PWFolderPath" -Verbose

    The script above pulls references, but the references are still using DMS folder paths instead of the relative local paths.

    • Sign in to reply
    • Cancel

    Top Replies

    • MWBSI
      MWBSI Fri, Apr 21 2023 10:35 PM in reply to Trevor Sedlock +2 verified
      Check out the Export-PWDocumentsSimple cmdlet in the latest release of PWPS_DAB. It should fix the reference files attachments of exported design files so that path information is substituted for PW_WORKDIR…
    Parents
    • Bill Graefe
      0 Offline Bill Graefe Mon, Feb 27 2023 12:32 PM

      The -useDMSFolders switch sounds broken. What happens if you use

      Export-PWDocuments -UseDMSFolders:$False

      Bill

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Trevor Sedlock
      0 Offline Trevor Sedlock Mon, Feb 27 2023 12:53 PM in reply to Bill Graefe

      Hi Bill. I tried your suggestion and it still didn't change the reference paths. Here's a screenshot comparing the results between the tool and the Powershell script.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • MWBSI
      0 MWBSI Mon, Feb 27 2023 3:36 PM in reply to Trevor Sedlock

      Actually from the first message you posted, it doesn't look like you were using the -UseDMSFolders switch in the first place.  You could try that and see if the references resolve any better after opening a master file from the exported DMS folder.  You can add the -UseDMSFolders switch to the last two lines of your script as follows:

      <#Export Docs#>
      Export-PWDocuments -InputDocuments (Get-PWDocumentsBySearch -FolderPath "$PWFolderPath") -OutputFolder "$LocalFolder" -Verbose -UseDMSFolders

      Export-PWDocuments -OutputFolder "$LocalFolder" -ProjectWiseFolder -UseDMSFolders "$PWFolderPath" -Verbose -UseDMSFolders 

      Let us know.

      Thanks,

      Mark Weisman | Bentley Systems

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Trevor Sedlock
      0 Offline Trevor Sedlock Tue, Feb 28 2023 8:18 AM in reply to MWBSI

      Hi Mark,

      I've re-run the original script I posted and added -UseDMSFolders as suggested. It changed the way the folder structure was built in my export location, but it did not change the references in the drawings to use relative pathing like the Folder Export tool does inside of ProjectWise. That's what we're hoping to accomplish via powershell. Here's the option we've been playing with in ProjectWise.

      When that option highlighted in the screenshot is not selected, the path for references starts with PW_WORKDIR which we do not want.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • MWBSI
      0 MWBSI Fri, Mar 17 2023 10:09 AM in reply to Trevor Sedlock

      Until we add this enhancement to Export-PWDocuments, please try adding a PW_WORKDIR environment variable either at the system level or in MicroStation.   Its value should be a full path to the root of the DMSFOLDER where the documents are exported.  Let us know if that helps.

      Mark Weisman | Bentley Systems

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • MWBSI
      +1 MWBSI Fri, Apr 21 2023 10:35 PM in reply to Trevor Sedlock

      Check out the Export-PWDocumentsSimple cmdlet in the latest release of PWPS_DAB.  It should fix the reference files attachments of exported design files so that path information is substituted for PW_WORKDIR.

      Mark Weisman | Bentley Systems

      Answer Verified By: Trevor Sedlock 

      • Cancel
      • Vote Up +2 Vote Down
      • Sign in to reply
      • Reject Answer
      • Cancel
    Reply
    • MWBSI
      +1 MWBSI Fri, Apr 21 2023 10:35 PM in reply to Trevor Sedlock

      Check out the Export-PWDocumentsSimple cmdlet in the latest release of PWPS_DAB.  It should fix the reference files attachments of exported design files so that path information is substituted for PW_WORKDIR.

      Mark Weisman | Bentley Systems

      Answer Verified By: Trevor Sedlock 

      • Cancel
      • Vote Up +2 Vote Down
      • Sign in to reply
      • Reject Answer
      • Cancel
    Children
    No Data

    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