RevitVersion.DefineConstants 1.0.0-rc.1

This is a prerelease version of RevitVersion.DefineConstants.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package RevitVersion.DefineConstants --version 1.0.0-rc.1
                    
NuGet\Install-Package RevitVersion.DefineConstants -Version 1.0.0-rc.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RevitVersion.DefineConstants" Version="1.0.0-rc.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RevitVersion.DefineConstants" Version="1.0.0-rc.1" />
                    
Directory.Packages.props
<PackageReference Include="RevitVersion.DefineConstants" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RevitVersion.DefineConstants --version 1.0.0-rc.1
                    
#r "nuget: RevitVersion.DefineConstants, 1.0.0-rc.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RevitVersion.DefineConstants@1.0.0-rc.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RevitVersion.DefineConstants&version=1.0.0-rc.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=RevitVersion.DefineConstants&version=1.0.0-rc.1&prerelease
                    
Install as a Cake Tool

RevitVersion.DefineConstants

Revit 2019+ Visual Studio 2022 Nuke License MIT Build Release

Convert RevitVersion property to DefineConstants with version 2019+ with or-greater-defines.

Installation

<PackageReference Include="RevitVersion.DefineConstants" Version="*-*" />
RevitVersion Define Define with or-greater
2019 REVIT2019 REVIT2019_OR_GREATER
2020 REVIT2020 REVIT2020_OR_GREATER, REVIT2019_OR_GREATER
2021 REVIT2021 REVIT2021_OR_GREATER, REVIT2020_OR_GREATER, REVIT2019_OR_GREATER
2022 REVIT2022 REVIT2022_OR_GREATER, REVIT2021_OR_GREATER, REVIT2020_OR_GREATER, REVIT2019_OR_GREATER
2023 REVIT2023 REVIT2023_OR_GREATER, REVIT2022_OR_GREATER, REVIT2021_OR_GREATER, REVIT2020_OR_GREATER, REVIT2019_OR_GREATER
2024 REVIT2024 REVIT2024_OR_GREATER, REVIT2023_OR_GREATER, REVIT2022_OR_GREATER, REVIT2021_OR_GREATER, REVIT2020_OR_GREATER, REVIT2019_OR_GREATER
2025 REVIT2025 REVIT2025_OR_GREATER, REVIT2024_OR_GREATER, REVIT2023_OR_GREATER, REVIT2022_OR_GREATER, REVIT2021_OR_GREATER, REVIT2020_OR_GREATER, REVIT2019_OR_GREATER

Example

RevitVersion 2024

<PropertyGroup>
  <RevitVersion>2024</RevitVersion>
</PropertyGroup>

Generate DefineConstants:

<PropertyGroup>
  <DefineConstants>$(DefineConstants);REVIT2024</DefineConstants>
  <DefineConstants>$(DefineConstants);REVIT2024_OR_GREATER;REVIT2023_OR_GREATER;REVIT2022_OR_GREATER;REVIT2021_OR_GREATER;REVIT2020_OR_GREATER;REVIT2019_OR_GREATER</DefineConstants>
</PropertyGroup>

Sample

public class Revit
{
#if REVIT2025
    public class Revit2025 { }
#endif
#if REVIT2024
    public class Revit2024 { }
#endif
#if REVIT2023
    public class Revit2023 { }
#endif
#if REVIT2022
    public class Revit2022 { }
#endif
#if REVIT2021
    public class Revit2021 { }
#endif
#if REVIT2020
    public class Revit2020 { }
#endif
#if REVIT2019
    public class Revit2019 { }
#endif

#if REVIT2025_OR_GREATER
    public class Revit2025OrGreater { }
#endif
#if REVIT2024_OR_GREATER
    public class Revit2024OrGreater { }
#endif
#if REVIT2023_OR_GREATER
    public class Revit2023OrGreater { }
#endif
#if REVIT2022_OR_GREATER
    public class Revit2022OrGreater { }
#endif
#if REVIT2021_OR_GREATER
    public class Revit2021OrGreater { }
#endif
#if REVIT2020_OR_GREATER
    public class Revit2020OrGreater { }
#endif
#if REVIT2019_OR_GREATER
    public class Revit2019OrGreater { }
#endif
}

RevitVersionMinimal

To set minimal version for XXX_OR_GREATER use RevitVersionMinimal:

<PropertyGroup>
  <RevitVersion>2024</RevitVersion>
  <RevitVersionMinimal>2021</RevitVersionMinimal>
</PropertyGroup>

Generate DefineConstants:

<PropertyGroup>
  <DefineConstants>$(DefineConstants);REVIT2024</DefineConstants>
  <DefineConstants>$(DefineConstants);REVIT2024_OR_GREATER;REVIT2023_OR_GREATER;REVIT2022_OR_GREATER;REVIT2021_OR_GREATER</DefineConstants>
</PropertyGroup>

The default value of RevitVersionMinimal is 2019.

SupportedRevitVersion

The SupportedRevitVersion is a ItemGroup that includes the version 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029 and 2030.

That's the range of versions that can be used in the RevitVersion and RevitVersionMinimal property.

License

This project is licensed under the MIT License.


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

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated