Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Using copy-PWDocument to copy a Document SET document
    • Sign In

    • State Not Answered
    • Replies 3 replies
    • Subscribers 67 subscribers
    • Views 645 views
    • Users 0 members are here

    Using copy-PWDocument to copy a Document SET document

    Robert Biggar
    Offline Robert Biggar over 2 years ago

    Hello;

    I am trying to copy a document SET document from one folder to a different folder

    If I use the PW explorer, it is as simple as "Copy" and "paste"...no big deal.

    but when I try to do it with "Copy-PWDocument" in a script file....it gives me an error:

    "WARNING: Error copying document 'Forms'. Error: 58072"

    58072  - "Cannot Copy document set"

    I tried the same syntax on a TXT file...no problems

    Tried it both with the paths and the file object...no good

    my test syntax:

    Copy-PWDocument -SourceDocumentNamePath "Resources\Development Resources\Design Submittal Requirements\z_Active Sets\ Forms" -TargetFolderPath "Lansing Support\biggarr\Test - No Configuration\-Supporting Documents"

    WARNING: Error copying document 'Forms'. Error: 58072

    with a txt file...no problem

    Copy-PWDocument -SourceDocumentNamePath "Lansing Support\biggarr\Test - No Configuration\New Text Document.txt" -TargetFolderPath "Lansing Support\biggarr\Test - No Configuration\-Supporting Documents"

    I know there is a "New" flatset Cmdlet, but not a special "copy"

    Any Ideas?

    Thank You!

    Bob 

    • Sign in to reply
    • Cancel
    • Dan Williams
      0 Offline Dan Williams Wed, Jun 16 2021 12:25 PM

      Robert Biggar,

      I'll have to look into this a bit further as I was able to reproduce the issue.

      In the meantime, you might have to examine each document to see if it is a flat set, and then create a new flat set in the target folder and add in the contents from the source flat set.  I didn't test this approach, so I might have overlooked something.

      Perhaps someone else can find or offer another method or perhaps a Cmdlet that I have overlooked...

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Robert Biggar
      0 Offline Robert Biggar Thu, Jun 17 2021 9:54 AM in reply to Dan Williams

      Thanks Dan! just knowing it can be reproduced helps...I hate to go to the trouble of "Programming around a problem"...when it was just something I was not doing correctly!  That could NEVER happen...right!  HA!

      Bob

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Robert Biggar
      0 Offline Robert Biggar Mon, Jun 21 2021 10:32 AM in reply to Dan Williams

      Hey, Dan. 

      I am looking into re-creating the SET...there is a "Create" and an "Add file"....looks promising.

      ...on a different note...

      This morning, one of our Batch processes failed while copying a Template structure.

      turns out it failed while copying a SET.

      the API function being called was "aaApi_MoveDocument"

      and the error it gave me was 58072 - Cannot copy document set

      I don't know if the Powershell CMDLet uses the same API call or if the Interface uses yet another call for the  "Copy/Paste" commands ???

      but... I figured I should throw it out there in case it is a "piece to the puzzle"

      My initial reaction was maybe a problem with a SET file....but you were able to reproduce this without the particular file...sooo....

      I am having the users remove the SET files and re-run the batch job....I will let you know if that helps.

      Thank You, Sir!

      Bob

      • Cancel
      • Vote Up -1 Vote Down
      • Sign in to reply
      • Verify Answer
      • 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