Methods for Mass Updating files in ProjectWise (Fixing Civil DWG's)

This article is a follow-up to the  Important Information for Civil 3d Users article on the Bentley Communities  Project Delivery: Content Management Forum. It is written to address the need to process a large number of DWG files at a time, due to an issue with an AutoCAD Civil 3d. But it could be used to script process any kind of file.

Summary of the Civil 3d Issue

  • Civil 3d users are encountering slowness opening files. This is due to the delivery of an Autodesk file AeccNetwork.dbx, that bloats any files opened with it in place.

  • This can happen in all versions. It happens in Civil 3d or any vertical using the Civil 3d object enablers, which does include vanilla AutoCAD.

  • File open will still be slow until all the files are repaired. Every file opened with the bad AeccNetwork.dbx must be repaired. This can include blocks, templates and other DWG based resources.

  • The script needs to run from the command line, that means outside ProjectWise.

Autodesk provides explicit instructions in the “Autodesk AutoCAD Civil 3D Performance Enhancement Tool (2014-2017).pdf.” There is a link to this file on Bentley Communities in the Important Information for Civil 3d Users article. The instructions for using the update script start on page 4 of the PDF. The link to the version specific file information is on page 2 of the PDF. 

Thoughts on Cleaning the DWG Files That Are in ProjectWise

There are several ways to clean the files. They all have pros and cons. It is critical that every file get cleaned in a way that tells ProjectWise a new local copy is needed That’s the only way to be sure that the next time a user opens a master file, every distributed file will get updated in the working folders.

 Here are my thoughts on the different methods. Please feel free to propose a better solution if you think of one.

  • Cleaning Files on the server (storage areas):  You cannot clean the files directly in the storage area, because the distributed local copies would not be updated. ProjectWise has no record of the change. Users will still have slow refs. You will have to run the bat file on every folder because there is no easy way to tell which of the folders in the storage area are affected.

  • Checkout, clean and check back in:  You can check files out, clean them in the working folders and check them back in. However, there is not an easy way to tell the copied out files from the checked out files.  So once again you wouldn’t guarantee all the files would get clean.
  • Clean all the files manually with Civil 3d. This is a straight forward solution. You could assign folders to project team members. They would check them all out. (Locking them) Then they would open them one at a time, save them and check them in to the project. On a small project this would work. The larger the project the more production time would be lost.

  • Bulk clean files using managed export from a search. One of the best options to bulk clean the files is to use managed export for an entire project’s files at a one time and then import them back in after resaving them. It is still possible that files from different projects would not get updated. But the number would be much smaller because most projects try to limit outside XRef’s. This script would only need to run on a single folder. But you can only import them back in from one folder at a time.   (See instructions below)

  • Bulk Clean Files using the Export\Import Excel Tool. The best option to clean the files. You get a list of the files that are exported.  You can import them back in using one step.  I am in the process of testing this method. (Instructions will be added once testing is done)

Mass Clean-Up Steps Using Managed Export

  1. Create a search to find the DWG Files and save it. This is an example search I used:

    For my saved search I selected the Project Root as the location to search, turned on sub-directories and set Application to AutoCAD.

  2. Run the search and select all the files.

  3. Right-Click and select Export

  4. When the Dialog Opens:

    Be sure and select Export not Send to Folder

  5. Set the export folder to a location that you can easily find from the command prompt:

    Select Next

  6. Select Export

  7. As the files Export you may encounter reference files that have already been exported and a dialog will ask how to handle them:

    It is safe to say No as you only need one copy and overwriting will take longer.

  8. You will need to rerun the saved search and check that everything was exported, in case some items were just copied out because they were References.

  9. Once the export is complete it is time to clean the files.

  10. Follow the Autodesk instructions in the pdf Autodesk AutoCAD Civil 3D Performance Enhancement Tool (2014-2017).

  11. I had an access issue with the bat file and script.
    The bat file copies the new AeccNetwork.dbx to the root directory of the AutoCAD version the bat file is written for, meaning you will need rights to write to this directory. I got around it by running the command prompt as Local Administrator.

  12. Make sure you have execute rights from the location of the bat file and script. Again resolved by running as admin.

  13. The Autodesk script file is very simple. Don’t give in to the temptation of complicating it with additional clean up steps.
    Although, In my testing, I did add one line to do an audit. (AU Y )
    If I have to open every file it is a good opportunity to make sure there are no major file structure issues.
    However; I didn’t add purge. It can be complicated to script and once the files are clean it only make 5 to 10 seconds difference to open. Adding purge more than doubled my processing time for the script.

  14. The Autodesk script doesn’t write output to a text file, you may want to add that.

  15. Once your script is running in ProjectWise rerun your search and look for files that didn’t export. There may be one or two that were checked out or otherwise locked. You can open these files and save them to manually clean them.

  16. Once the AutoCAD script is done running you will have a .bak file for every one that processed. On my test project there was one bad file that wouldn’t open. I cleaned that one manually with recover.

  17. Also while the script file is running is a good time to clean the templates and common references located outside of the structure that you searched.

  18. Once the script has run you will need to import the files into ProjectWise. It is not possible to import all the files at once from a search. Here are three different options:
    • You can go to each folder in ProjectWise and select the exported files to import them. This is good if you are only processing a couple of folders.

    • You can add the folder ID to the search folder and sort by folder to import one folder at a time. This works best for a search that returns a single project of limited number of files. <100~

    • You can import the files from the Local Document Organizer. This is best for very large numbers of files.

Jan 9, 2017

  • Updated to add information for making sure that all the references are exported. (See Item 8)
  • Added two additional methods to import the files.

  • For the last step, you don't need to use saved search but use 'Local Document Organizer' from ProjectWise Explorer to import all the files at once.

    Any idea to get exported and checked-out the reference files automatically if we process by root folder in ProjectWise, in order to clean all the references files and not only the master files. Excel Export or Managed Export only check-out the master files and not the references which are only copy out, so the import does not affect them in ProjectWise?