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
+3 -2
View File
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2020 by Autodesk, Inc. All rights reserved.
// (C) Copyright 2003-2023 by Autodesk, Inc. All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted
@@ -22,6 +22,7 @@
using System;
using System.IO;
using System.Resources;
using System.Windows.Media.Imaging;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
@@ -89,7 +90,7 @@ namespace Revit.SDK.Samples.CloudAPISample.CS
pushButton.Enabled = true;
pushButton.LargeImage =
new BitmapImage(new Uri(Path.Combine(Path.GetDirectoryName(assemblyPath) ?? string.Empty, "icon.ico")));
new BitmapImage(new Uri(Path.Combine(Path.GetDirectoryName(assemblyPath) ?? string.Empty, "Resources", "icon.ico")));
pushButton.AvailabilityClassName = " Revit.SDK.Samples.CloudAPISample.CS.RunSampleCommand";
return Result.Succeeded;
@@ -1,138 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
None
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8A4EA589-A668-4824-9C1D-56B6A53DE304}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CloudAPISample</RootNamespace>
<AssemblyName>CloudAPISample</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<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\CloudAPISample.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>
<DocumentationFile>bin\Release\CloudAPISample.XML</DocumentationFile>
</PropertyGroup>
<Project Sdk="">
<Import Project="$(SolutionDir)VSProps\SDKSamples.Sdk.props" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\CloudAPISample.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Release\CloudAPISample.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Numerics" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
<Reference Include="System.Core">
<RequiredTargetFramework>4.7</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<None Remove="View\ViewInputMigrationInfo.xaml" />
<None Remove="View\ViewMigrationToBim360.xaml" />
<None Remove="View\ViewSamplePortal.xaml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Application.cs" />
<Compile Include="Coroutine\Coroutine.cs" />
<Compile Include="Coroutine\CoroutineScheduler.cs" />
<Compile Include="Samples\Migration\IMigrationModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SampleContext.cs" />
<Compile Include="SampleEngine.cs" />
<Compile Include="Samples\Migration\MigrationToBim360.cs" />
<Compile Include="Samples\Migration\UIMigrationViewModel.cs" />
<Compile Include="View\ViewInputMigrationInfo.xaml.cs">
<DependentUpon>ViewInputMigrationInfo.xaml</DependentUpon>
</Compile>
<Compile Include="View\ViewSamplePortal.xaml.cs">
<DependentUpon>ViewSamplePortal.xaml</DependentUpon>
</Compile>
<Compile Include="View\ViewMigrationToBim360.xaml.cs">
<DependentUpon>ViewMigrationToBim360.xaml</DependentUpon>
</Compile>
<Content Include="Resources\icon.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Page Include="View\ViewInputMigrationInfo.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\ViewSamplePortal.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\ViewMigrationToBim360.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<Content Include="Resources\icon.ico" />
<Page Include="View\ViewInputMigrationInfo.xaml" />
<Page Include="View\ViewMigrationToBim360.xaml" />
<Page Include="View\ViewSamplePortal.xaml" />
</ItemGroup>
<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>
</PropertyGroup>
</Project>
</Project>
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2020 by Autodesk, Inc. All rights reserved.
// (C) Copyright 2003-2023 by Autodesk, Inc. All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2020 by Autodesk, Inc. All rights reserved.
// (C) Copyright 2003-2023 by Autodesk, Inc. All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2020 by Autodesk, Inc. All rights reserved.
// (C) Copyright 2003-2023 by Autodesk, Inc. All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted
@@ -21,7 +21,6 @@
// (Rights in Technical Data and Computer Software), as applicable.
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
@@ -56,3 +55,4 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("windows7.0")]
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2020 by Autodesk, Inc. All rights reserved.
// (C) Copyright 2003-2023 by Autodesk, Inc. All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2020 by Autodesk, Inc. All rights reserved.
// (C) Copyright 2003-2023 by Autodesk, Inc. All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2020 by Autodesk, Inc. All rights reserved.
// (C) Copyright 2003-2023 by Autodesk, Inc. All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2020 by Autodesk, Inc. All rights reserved.
// (C) Copyright 2003-2023 by Autodesk, Inc. All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted
@@ -26,10 +26,10 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Web.Script.Serialization;
using System.Windows;
using Autodesk.Revit.DB;
using Revit.SDK.Samples.CloudAPISample.CS.View;
using Newtonsoft.Json;
namespace Revit.SDK.Samples.CloudAPISample.CS.Migration
{
@@ -148,8 +148,7 @@ namespace Revit.SDK.Samples.CloudAPISample.CS.Migration
}
// All link info should be dump to local file in case something wrong happens during uploading process
JavaScriptSerializer serializer = new JavaScriptSerializer();
var jsonString = serializer.Serialize(mapLocalModelPathToLinksName);
var jsonString = JsonConvert.SerializeObject(mapLocalModelPathToLinksName);
File.WriteAllText(FLinksInfo, jsonString);
@@ -186,7 +185,7 @@ namespace Revit.SDK.Samples.CloudAPISample.CS.Migration
yield return null;
}
jsonString = serializer.Serialize(mapModelsNameToGuid);
jsonString = JsonConvert.SerializeObject(mapModelsNameToGuid);
File.WriteAllText(FModelsGuid, jsonString);
view.UpdateUploadingProgress("Uploading finished", 100);
@@ -218,10 +217,9 @@ namespace Revit.SDK.Samples.CloudAPISample.CS.Migration
// Read mapping info
var jsonString = File.ReadAllText(FLinksInfo);
JavaScriptSerializer serializer = new JavaScriptSerializer();
var mapLocalModelPathToLinksName = serializer.Deserialize<Dictionary<string, List<string>>>(jsonString);
var mapLocalModelPathToLinksName = JsonConvert.DeserializeObject<Dictionary<string, List<string>>>(jsonString);
jsonString = File.ReadAllText(FModelsGuid);
var mapModelsNameToGuid = serializer.Deserialize<Dictionary<string, string>>(jsonString);
var mapModelsNameToGuid = JsonConvert.DeserializeObject<Dictionary<string, string>>(jsonString);
// Try to open each cloud model and reload if they have links, making that point to cloud path.
foreach (var kvp in mapLocalModelPathToLinksName)
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2020 by Autodesk, Inc. All rights reserved.
// (C) Copyright 2003-2023 by Autodesk, Inc. All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2020 by Autodesk, Inc. All rights reserved.
// (C) Copyright 2003-2023 by Autodesk, Inc. All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted
@@ -23,9 +23,9 @@
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Web.Script.Serialization;
using System.Windows;
using Microsoft.Win32;
using Newtonsoft.Json;
using Revit.SDK.Samples.CloudAPISample.CS.Migration;
namespace Revit.SDK.Samples.CloudAPISample.CS.View
@@ -64,8 +64,7 @@ namespace Revit.SDK.Samples.CloudAPISample.CS.View
{
var model = ((MigrationToBim360) DataContext).Model;
var jsonString = File.ReadAllText(openFileDialog.FileName);
JavaScriptSerializer serializer = new JavaScriptSerializer();
var info = serializer.Deserialize<SerializableProjectInfo>(jsonString);
var info = JsonConvert.DeserializeObject<SerializableProjectInfo>(jsonString);
model.AccountGuid = info.AccountGuid;
model.ProjectGuid = info.ProjectGuid;
@@ -86,8 +85,7 @@ namespace Revit.SDK.Samples.CloudAPISample.CS.View
ProjectGuid = model.ProjectGuid,
AvailableFolders = model.AvailableFolders.ToArray()
};
JavaScriptSerializer serializer = new JavaScriptSerializer();
var jsonString = serializer.Serialize(info);
var jsonString = JsonConvert.SerializeObject(info);
File.WriteAllText(saveFileDialog.FileName, jsonString);
}
}
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2020 by Autodesk, Inc. All rights reserved.
// (C) Copyright 2003-2023 by Autodesk, Inc. All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2020 by Autodesk, Inc. All rights reserved.
// (C) Copyright 2003-2023 by Autodesk, Inc. All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted