Menu

What Causes Revit Data Corruption?

Issue:
What causes Revit® data corruption?

Cause:

The causes of data corruption are varied, but to understand them we need to clearly understand what corruption is.

Element Level Corruption:

  • When elements are modified within a model, the modification can affect other objects which interact with the first modified object. This modification can then impact other elements, as the change is propagated through the model.
  • Each element is expected to have certain properties/parameters, and these can be modified in certain pre-defined ways.
  • When element gets into a state so that it has properties that it shouldn’t, or it has values that it shouldn’t, the element can be said to be corrupt.
  • A corrupt element may be able to exist within the project without leading to errors so long as Revit does not try to modify or refresh/redraw/interact with this element.
  • Once Revit tries to modify the object and the unexpected state of the element causes the modification to fail, then Revit will try to recover. If the failure is severe or there are too many corrupt elements then the current operation will fail, and Revit will then try to restore to a prior state (undo the current operation). If this fails, then an error is presented to the user.

Project Level Corruption:

Beyond element level corruption, there can also be more widespread project corruption such as:

  • Missing elements: Instead of bad data within elements, one or more elements referenced in the model are missing.
  • Data streams with bad or blank information: The RVT format is compressed, and when the model is opened the data streams are decompressed into the %TMP% folder. If Revit can’t decompress the data, or deserialize the stored data into memory, Revit will be unable to open the model.
  • Unreadable data streams: If the model is not fully or properly written to the storage media, then Revit may not be able to read one or more of the data streams as it tries to decompress the model.


The symptoms of element and project corruption can be varied, including but not limited to:

Element Corruption:

  • Error: “Element <Element ID> has become corrupt at some time before this session” (An Audit will often clear this if there are not too many corrupt elements and the issue is not too severe.)
  • Failure to modify certain elements.
  • Failure to open certain views.
  • Failure to save the model.
  • Crash when performing certain operations (e.g. synchronize with Central, Transfer Project Standards, Audit, Purge Unused, and etcetera).
  • Failure to open the model (as many objects are redrawn/refreshed during this process).

Project Corruption:

 

  • Failure to open the model.
  • Crash when opening certain views.
  • Crash when performing certain operations (e.g. synchronize with Central, Transfer Project Standards, Audit, Purge Unused, and etcetera).

What can lead to corruption?

 

The causes of corruption are also varied, including but not limited to:

  • Read/write failure to the storage media.
  • Program crashes (especially when writing data to the RVT model).
  • An add-in that modifies elements in ways not possible or desired through the normal UI.
  • Untested operations or series of operations (e.g. canceling a synchronize, or using the Undo command after synchronizing).

 

Solution:

To minimize the incidence of data corruption, do the following:

  1. Ensure that you will have a good backup copy of the project. Corruption can be introduced during an editing session, and when this happens each saves operation will cause a good backup to be lost and a bad backup to be created. If the number of automatic backups is less than the number of save operations then all of the good backups will be lost. To ensure you will have a good backup you can do one or both of the following:
    • Increase the number of automatic backups to a number greater than the number of saves that will be made within a single editing session (i.e. if you save on average less than 50 times per editing session, increase the number of backups to more than 50).
    • Make manual backups. Create a separate copy of the project in addition to the automatic backups.
  2. Audit the project periodically (more commonly once per week, but if the rate of change in the project is higher this should be done more frequently). Revit tries to be tolerant of errors and will ignore them when it can. However, as the number of errors increases eventually, it will be unable to continue. Using Audit can clear out problematic data, and serve as a warning if you find that Audit starts failing.
  3. Ensure that Revit is updated. As we identify issues that will lead to corruption, the code is modified to prevent this.
  4. Keep non-workshared files and local workshared files on the local hard drive. Writing directly to a network path increases the chance of a read/write failure.
  5. Ensure that there is at least 5GBs (or whatever is specified in the System Requirements) of hard disk space available. If Revit is unable to write to the hard drive because it is full, then the resulting model would be incomplete and unusable.
  6. Ensure that the %TMP% folder is periodically emptied. When an RVT file is opened it is decompressed into the temp folder, and Revit works from this location. If Revit is unable to read/write to this folder this can lead to corruption or spurious corruption messages. (As with item 3, ensure the %TMP% folder is located on the local hard drive).
  7. Avoid using the Undo command after synchronizing, or canceling a synchronizing process. This can put the model in an inconsistent state where parts are updated and parts are not.
  8. Keep the number of warnings to a minimum. Warnings point to possible problems with the project. When there are a large number of warnings, there is a larger chance that Revit will have issues updating the associated elements.
  9. Ensure that you have a copy of the program that originally wrote the file. If you are archiving model data (Auditing, Purging, and clearing warnings), you may run into errors when upgrading to newer versions. If you can open the file in the original version that wrote the file, you have a better chance of making changes in that version which will then allow the model to be upgraded. Keep in mind that Revit is only supported back to three versions. If you will be keeping model data longer than this, you may want to keep both the original and an upgraded copy (ensuring that the upgrade is successful each year).
Categories: BIM, IT, Software Solutions
SHARE THIS

About the author

Roger specializes in all things architecture & 3D printing, & has been with Microsol since 2001. He provides technical support for our architectural building, architectural interiors & structural design clients.