Autodesk.Revit.Sdk.Refs.2024 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Autodesk.Revit.Sdk.Refs.2024 --version 1.0.0                
NuGet\Install-Package Autodesk.Revit.Sdk.Refs.2024 -Version 1.0.0                
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="Autodesk.Revit.Sdk.Refs.2024" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Autodesk.Revit.Sdk.Refs.2024 --version 1.0.0                
#r "nuget: Autodesk.Revit.Sdk.Refs.2024, 1.0.0"                
#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.
// Install Autodesk.Revit.Sdk.Refs.2024 as a Cake Addin
#addin nuget:?package=Autodesk.Revit.Sdk.Refs.2024&version=1.0.0

// Install Autodesk.Revit.Sdk.Refs.2024 as a Cake Tool
#tool nuget:?package=Autodesk.Revit.Sdk.Refs.2024&version=1.0.0                

Autodesk.Revit.SDK.Refs

JetBrains Rider License MIT Revit 2016-2024

Revit SDK refs assemblies.
Only metadata from assemblies by Refasmer.

Usage

Add project configurations with revit versions in name

<PropertyGroup>
    <RevitVersion>2016</RevitVersion> 
    <TargetFramework>net45</TargetFramework> 
    <Configurations>Debug;Release;D2016;D2017;D2018;D2019;D2020;D2021;D2022;D2023;D2024</Configurations>
</PropertyGroup>

Add package reference

<ItemGroup>
    
    <PackageReference Include="Autodesk.Revit.Sdk.Refs.$(RevitVersion)" Version="*" />
</ItemGroup>

Create <RevitVersion> build props

<Project>
    <PropertyGroup Condition="$(Configuration.Contains('&lt;RevitVersion&gt;'))">
        <RevitVersion>&lt;RevitVersion&gt;</RevitVersion>
        <TargetFramework>&lt;TargetFramework&gt;</TargetFramework>
    </PropertyGroup>

    <PropertyGroup Condition="'$(RevitVersion)' != '' and $(RevitVersion) == &lt;RevitVersion&gt;">
        <DefineConstants>$(DefineConstants);REVIT_&lt;RevitVersion&gt;</DefineConstants>
    </PropertyGroup>

    <PropertyGroup Condition="'$(RevitVersion)' != '' and $(RevitVersion) &lt;= &lt;RevitVersion&gt;">
        <DefineConstants>$(DefineConstants);REVIT_&lt;RevitVersion&gt;_OR_LESS</DefineConstants>
    </PropertyGroup>

    <PropertyGroup Condition="'$(RevitVersion)' != '' and $(RevitVersion) &gt;= &lt;RevitVersion&gt;">
        <DefineConstants>$(DefineConstants);REVIT_&lt;RevitVersion&gt;_OR_GREATER</DefineConstants>
    </PropertyGroup>
</Project>

Build Revit Project

See sample project in this folder.
You should compile the Debug configuration.
Other configurations needs to help write code with constants.

dotnet cli
dotnet build -c <Configuration> -p:RevitVersion=<RevitVersion>
nuke build
DotNetBuild(s => s
    .DisableNoRestore()
    .SetProjectFile(<ProjectName>)
    .SetConfiguration(<Configuration>)
    .SetProperty("RevitVersion", (int) RevitVersion.Rv<RevitVersion>));

Defined constants

This constants defined to all supports revit version.

REVIT_<RevitVersion>  
REVIT_<RevitVersion>_OR_LESS  
REVIT_<RevitVersion>_OR_GREATER  

Usage defined constants

#if REVIT_<RevitVersion>
    // This code will be available for the specified version
#endif

#if REVIT_<RevitVersion>_OR_LESS
     // This code will be available for all versions less than specified
#endif

#if REVIT_<RevitVersion>_OR_GREATER
     // This code will be available for all versions greater than specified
#endif
Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.1.1 1,052 4/12/2024
1.1.0 193 4/12/2024
1.0.0 349 11/9/2023