integrate Revit 2025 SDK

This commit is contained in:
Jeremy Tammik
2024-04-11 13:47:20 +02:00
parent e786953544
commit f414362f2b
889 changed files with 26676 additions and 26865 deletions
@@ -1,90 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{77CE4920-1BE6-4174-88BB-2892E71ACD11}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Revit.SDK.Samples.ExternalResourceDBServer.CS</RootNamespace>
<AssemblyName>ExternalResourceDBServer</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\ExternalResourceDBServer.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<Import Project="$(SolutionDir)VSProps\SDKSamples.Sdk.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\ExternalResourceDBServer.XML</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Application.cs" />
<Compile Include="KeynotesDatabase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SampleExternalResourceDBServer.cs" />
<Compile Include="ServerInterfaceExtensionsForRevitLinks.cs" />
</ItemGroup>
<Import Project="$(SolutionDir)VSProps\SDKSamples.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<Import Project="$(SolutionDir)VSProps\SDKSamples.Sdk.targets" />
<PropertyGroup>
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.py"
if exist %25FILEFORSAMPLEREG%25 py -3 %25FILEFORSAMPLEREG%25 "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
@@ -271,16 +271,16 @@ namespace Revit.SDK.Samples.ExternalResourceDBServer.CS
// The following checks can help with testing. However, they should not be necessary, since Revit checks all input paramters
// before calling this method.
if (loadRequestId == null)
throw new ArgumentNullException("loadRequestId");;
if (loadRequestId == Guid.Empty)
throw new ArgumentNullException("loadRequestId");
if (resourceType == null)
throw new ArgumentNullException("resourceType");;
throw new ArgumentNullException("resourceType");
if (resourceReference == null)
throw new ArgumentNullException("resourceReference");;
throw new ArgumentNullException("resourceReference");
if (loadContext == null)
throw new ArgumentNullException("loadContext");;
throw new ArgumentNullException("loadContext");
if (loadContent == null)
throw new ArgumentNullException("loadContent");;
throw new ArgumentNullException("loadContent");
if (!SupportsExternalResourceType(resourceType))
throw new ArgumentOutOfRangeException("resourceType", "The specified resource type is not supported by this server.");
@@ -1,78 +0,0 @@
//
// (C) Copyright 2003-2019 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.Revit;
using Autodesk.Revit.DB;
namespace Revit.SDK.Samples.ExternalResourceDBServer.CS
{
/// <summary>
/// Extension operator to support "Open (and Unload)" command.
/// Revit will call this method to determine the location of the locally-cached copy
/// of the linked model, and will open that copy directly.
/// </summary>
//=====================================================================================
public class GetLinkPathForOpen : IGetLocalPathForOpenCallback
{
/// <summary>
/// This implementation simply retrieves the same local file name that the server
/// uses when first copying the link document to the user's machine.
/// </summary>
public string GetLocalPathForOpen(ExternalResourceReference desiredReference)
{
return SampleExternalResourceDBServer.GetFullLinkCachedFilePath(desiredReference);
}
}
/// <summary>
/// Extension operator to support handle updates when the user saves new shared coordinates in the
/// local copy of a link.
/// </summary>
//=====================================================================================
public class LocalLinkSharedCoordinatesSaved : IOnLocalLinkSharedCoordinatesSavedCallback
{
/// <summary>
/// When the user updates the shared coordinates in the link model, Revit calls this
/// method. In this implementation, the updated local version of the link on the user's
/// machine is uploaded (copied) back to the server location.
/// </summary>
public void OnLocalLinkSharedCoordinatesSaved(ExternalResourceReference changedReference)
{
string localLinkPath = SampleExternalResourceDBServer.GetFullLinkCachedFilePath(changedReference);
string fullServerPath = SampleExternalResourceDBServer.GetFullServerLinkFilePath(changedReference);
String serverDirectoryName = System.IO.Path.GetDirectoryName(fullServerPath);
if (!System.IO.Directory.Exists(serverDirectoryName))
{
System.IO.Directory.CreateDirectory(serverDirectoryName);
}
System.IO.File.Copy(localLinkPath, fullServerPath, true); // Overwrite
}
}
}