Skip to content

ricaun.Revit.FileInfo library allows to check the version of an Autodesk Revit file without opening.

License

Notifications You must be signed in to change notification settings

ricaun-io/ricaun.Revit.FileInfo

Repository files navigation

ricaun.Revit.FileInfo

ricaun.Revit.FileInfo library allows to check the version of an Autodesk Revit file (.rvt, .rfa, .rte, .rft) without opening.

Revit 2024 Visual Studio 2022 Nuke License MIT Build .NET Framework 4.0 Release

PackageReference

<PackageReference Include="ricaun.Revit.FileInfo" Version="*" />

Example

using ricaun.Revit.FileInfo;
RevitVersion revitVersion = RevitFileInfo.GetRevitVersion(filePath);

or

RevitFileInfo revitFileInfo = new RevitFileInfo(filePath);
bool isValid = revitFileInfo.IsValid;
RevitVersion revitVersion = revitFileInfo.Version;

RevitFileInfo

  • IsValid: Check if the file is a valid Revit file extension. (.rvt, .rfa, .rte, .rft)
  • Version: Get the RevitVersion of the file. RevitVersion is an int with the default value zero or RevitVersion.Unknown.

BasicFileInfo

To find the version of the Revit file the BasicFileInfoUtils is used, and a regex is used to find the version in te Revit Build: or Format: info.

  • Revit 2018 and below: Revit Build: Autodesk Revit 2018 (Build: 20170106_1515(x64)).
  • Revit 2019 and above: Format: 2019.

A Unit test is used to check if the regex is working correctly between the different Revit file versions (2014-2024).

References

This project was inspired by the following projects:

License

This project is licensed under the MIT Licence.


Do you like this project? Please star this project on GitHub!

About

ricaun.Revit.FileInfo library allows to check the version of an Autodesk Revit file without opening.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project