DocumentVersion
This class uniquely identifies an edition of a given document.
Inheritance Hierarchy
System.Object
Autodesk.Revit.DB.DocumentVersion
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public class DocumentVersion : IDisposable
The DocumentVersion type exposes the following members.
Properties
Name
Description
Public Property
IsValidObject
Specifies whether the .NET object represents a valid Revit entity.
Public Property
NumberOfSaves
The number of times the document has been saved. The save number and GUID are both necessary to uniquely identify a document version.
Public Property
VersionGUID
The GUID portion of the DocumentVersion. The GUID is updated when changes are made to the document, but may not update with every change to the document. The GUID and save number are both necessary to uniquely identify a document version.
Methods
Name
Description
Public Method
Dispose
Releases all resources used by the DocumentVersion
Public Method
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object)
Public Method
GetHashCode
Serves as the default hash function.
(Inherited from Object)
Public Method
GetType
Gets the Type of the current instance.
(Inherited from Object)
Public Method
IsEqual
Checks whether two DocumentVersions are identical. They are identical if both the GUID and number of saves are equal. If two DocumentVersions are identical, they come from the same document, with the same set of changes.
Public Method
ToString
Returns a string that represents the current object.
(Inherited from Object)
Remarks
DocumentVersion consists of two parts - a GUID and an integer. The GUID is updated as new elements are created in the document, but it is not necessarily changed whenever any individual change is made to the document. The integer is updated when the document is saved.
The GUID will change as changes are made to a model, so it should not be treated as a static value.
This class does not contain any time information - you cannot compare two DocumentVersions and know which document is newer. It can be used to tell whether a document has changed since it was last inspected. See
GetDocumentVersion.