Skip to content

Open-source Revit MCP server: let Claude and other AI assistants read and edit BIM models, with human approval on every change.

3.7 KB
Raw Blame
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <RevitVersion Condition="'$(RevitVersion)'==''">2024</RevitVersion>
    <TargetFramework Condition="'$(RevitVersion)' == '2024'">net48</TargetFramework>
    <TargetFramework Condition="'$(RevitVersion)' == '2025' OR '$(RevitVersion)' == '2026'">net8.0-windows</TargetFramework>
    <TargetFramework Condition="'$(RevitVersion)' == '2027'">net10.0-windows</TargetFramework>
    <AssemblyName>AECModelBridge</AssemblyName>
    <RootNamespace>RevitBridge</RootNamespace>
    <Version>1.4.0</Version>
    <AssemblyVersion>1.4.0.0</AssemblyVersion>
    <FileVersion>1.4.0.0</FileVersion>
    <InformationalVersion>1.4.0</InformationalVersion>
    <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
    <OutputType>Library</OutputType>
    <OutputPath>bin\$(Configuration)\$(RevitVersion)\</OutputPath>
    <LangVersion>latest</LangVersion>
    <Nullable>enable</Nullable>
    <UseWPF>true</UseWPF>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
  </PropertyGroup>

  <PropertyGroup>
    <RevitInstallPath Condition="'$(RevitVersion)'=='2024'">C:\Program Files\Autodesk\Revit 2024</RevitInstallPath>
    <RevitInstallPath Condition="'$(RevitVersion)'=='2025'">C:\Program Files\Autodesk\Revit 2025</RevitInstallPath>
    <RevitInstallPath Condition="'$(RevitVersion)'=='2026'">C:\Program Files\Autodesk\Revit 2026</RevitInstallPath>
    <RevitInstallPath Condition="'$(RevitVersion)'=='2027'">C:\Program Files\Autodesk\Revit 2027</RevitInstallPath>
    <!-- Check if local Revit API exists, otherwise default to NuGet -->
    <UseLocalRevit Condition="Exists('$(RevitInstallPath)\RevitAPI.dll')">true</UseLocalRevit>
    <UseLocalRevit Condition="'$(UseLocalRevit)'==''">false</UseLocalRevit>
  </PropertyGroup>

  <!-- Local Revit References -->
  <ItemGroup Condition="'$(UseLocalRevit)'=='true'">
    <Reference Include="RevitAPI">
      <HintPath>$(RevitInstallPath)\RevitAPI.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="RevitAPIUI">
      <HintPath>$(RevitInstallPath)\RevitAPIUI.dll</HintPath>
      <Private>False</Private>
    </Reference>
  </ItemGroup>

  <!-- Fallback to NuGet packages (CI/Mock mode) -->
  <ItemGroup Condition="'$(UseLocalRevit)'=='false'">
    <PackageReference Include="Nice3point.Revit.Api.RevitAPI" Version="$(RevitVersion).*" />
    <PackageReference Include="Nice3point.Revit.Api.RevitAPIUI" Version="$(RevitVersion).*" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2478.35" />
    <PackageReference Include="Serilog" Version="3.1.1" />
    <PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
    <PackageReference Include="System.Text.Json" Version="6.0.10" Condition="'$(TargetFramework)'=='net48'" />
    <!-- IronPython enables in-process scripting with broad public Revit API access. -->
    <PackageReference Include="IronPython" Version="2.7.12" Condition="'$(TargetFramework)'=='net48'" />
    <PackageReference Include="IronPython" Version="3.4.1" Condition="'$(TargetFramework)'!='net48'" />
  </ItemGroup>

  <ItemGroup>
    <Content Include="..\..\panel\**\*">
      <Link>panel\%(RecursiveDir)%(Filename)%(Extension)</Link>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

  <!-- .NET Framework requires explicit WPF references; modern SDK targets use UseWPF. -->
  <ItemGroup Condition="'$(TargetFramework)'=='net48'">
    <Reference Include="PresentationCore" />
    <Reference Include="PresentationFramework" />
    <Reference Include="WindowsBase" />
    <Reference Include="System.Xaml" />
    <Reference Include="System.Net.Http" />
  </ItemGroup>

</Project>