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,113 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C6D32355-2C27-4A24-9BE4-11F3E78C301E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CurtainWallGrid</RootNamespace>
<AssemblyName>CurtainWallGrid</AssemblyName>
<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>
</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>
<Project Sdk="">
<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>
<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.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Command.cs" />
<Compile Include="GridCoordinates.cs" />
<Compile Include="MyDocument.cs" />
<Compile Include="GridDrawing.cs" />
<Compile Include="GridForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GridForm.Designer.cs">
<DependentUpon>GridForm.cs</DependentUpon>
</Compile>
<Compile Include="GridGeometry.cs" />
<Compile Include="GridLine2D.cs" />
<Compile Include="GridProperties.cs" />
<Compile Include="MathTools.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Unit.cs" />
<Compile Include="Utility.cs" />
<Compile Include="WallGeometry.cs" />
<Compile Include="WallDrawing.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="GridForm.resx">
<SubType>Designer</SubType>
<DependentUpon>GridForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<SubType>Designer</SubType>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</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>
@@ -140,7 +140,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
if (null == drawing)
{
TaskDialog.Show("Revit", "Error! There's no grid information in the curtain wall.");
Autodesk.Revit.UI.TaskDialog.Show("Revit", "Error! There's no grid information in the curtain wall.");
}
m_drawing = drawing;
drawing.Coordinates = this;
@@ -364,7 +364,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
if (null == geometry)
{
TaskDialog.Show("Revit", "Error! There's no grid information in the curtain wall.");
Autodesk.Revit.UI.TaskDialog.Show("Revit", "Error! There's no grid information in the curtain wall.");
}
else
{
+11 -11
View File
@@ -363,7 +363,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
catch (System.Exception e)
{
TaskDialog.Show("Exception", e.Message);
Autodesk.Revit.UI.TaskDialog.Show("Exception", e.Message);
return;
}
}
@@ -429,7 +429,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
catch (System.Exception e)
{
TaskDialog.Show("Exception", e.Message);
Autodesk.Revit.UI.TaskDialog.Show("Exception", e.Message);
return;
}
}
@@ -456,7 +456,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
catch (System.Exception e)
{
TaskDialog.Show("Exception", e.Message);
Autodesk.Revit.UI.TaskDialog.Show("Exception", e.Message);
return;
}
}
@@ -498,7 +498,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
catch (System.Exception e)
{
TaskDialog.Show("Exception", e.Message);
Autodesk.Revit.UI.TaskDialog.Show("Exception", e.Message);
return;
}
}
@@ -524,7 +524,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
catch (System.Exception e)
{
TaskDialog.Show("Exception", e.Message);
Autodesk.Revit.UI.TaskDialog.Show("Exception", e.Message);
return;
}
}
@@ -586,7 +586,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
catch (System.Exception e)
{
TaskDialog.Show("Exception", e.Message);
Autodesk.Revit.UI.TaskDialog.Show("Exception", e.Message);
// "add U line" failed, so return directly
return;
}
@@ -641,7 +641,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
catch (System.Exception e)
{
TaskDialog.Show("Exception", e.Message);
Autodesk.Revit.UI.TaskDialog.Show("Exception", e.Message);
// "add V line" failed, so return directly
return;
}
@@ -756,7 +756,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
catch (System.Exception e)
{
TaskDialog.Show("Exception", e.Message);
Autodesk.Revit.UI.TaskDialog.Show("Exception", e.Message);
return false;
}
act.Commit();
@@ -805,7 +805,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
catch (System.Exception e)
{
TaskDialog.Show("Exception", e.Message);
Autodesk.Revit.UI.TaskDialog.Show("Exception", e.Message);
return false;
}
act.Commit();
@@ -867,7 +867,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
catch (System.Exception e)
{
TaskDialog.Show("Exception", e.Message);
Autodesk.Revit.UI.TaskDialog.Show("Exception", e.Message);
return;
}
act.Commit();
@@ -899,7 +899,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
catch (System.Exception e)
{
TaskDialog.Show("Exception", e.Message);
Autodesk.Revit.UI.TaskDialog.Show("Exception", e.Message);
return;
}
act.Commit();
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2019 by Autodesk, Inc.
// (C) Copyright 2003-2024 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,
@@ -90,7 +90,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// stores the data of vertical justification
/// </summary>
[CategoryAttribute("Vertical Grid Pattern"), DefaultValueAttribute(CurtainGridAlign.Beginning), ReadOnlyAttribute(true)]
[Category("Vertical Grid Pattern"), DefaultValue(CurtainGridAlign.Beginning), ReadOnly(true)]
public CurtainGridAlign VerticalJustification
{
get
@@ -106,7 +106,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// stores the data of vertical angle
/// </summary>
[CategoryAttribute("Vertical Grid Pattern"), DefaultValueAttribute(0.0), ReadOnlyAttribute(true)]
[Category("Vertical Grid Pattern"), DefaultValue(0.0), ReadOnly(true)]
public double VerticalAngle
{
get
@@ -122,7 +122,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// stores the data of vertical offset
/// </summary>
[CategoryAttribute("Vertical Grid Pattern"), DefaultValueAttribute(0.0), ReadOnlyAttribute(true)]
[Category("Vertical Grid Pattern"), DefaultValue(0.0), ReadOnly(true)]
public double VerticalOffset
{
get
@@ -138,7 +138,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// stores how many U lines there are in the grid
/// </summary>
[CategoryAttribute("Vertical Grid Pattern"), DefaultValueAttribute(0), ReadOnlyAttribute(true)]
[Category("Vertical Grid Pattern"), DefaultValue(0), ReadOnly(true)]
public int VerticalLinesNumber
{
get
@@ -154,7 +154,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// stores the data of horizontal justification
/// </summary>
[CategoryAttribute("Horizontal Grid Pattern"), DefaultValueAttribute(CurtainGridAlign.Beginning), ReadOnlyAttribute(true)]
[Category("Horizontal Grid Pattern"), DefaultValue(CurtainGridAlign.Beginning), ReadOnly(true)]
public CurtainGridAlign HorizontalJustification
{
get
@@ -170,7 +170,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// stores the data of horizontal angle
/// </summary>
[CategoryAttribute("Horizontal Grid Pattern"), DefaultValueAttribute(0.0), ReadOnlyAttribute(true)]
[Category("Horizontal Grid Pattern"), DefaultValue(0.0), ReadOnly(true)]
public double HorizontalAngle
{
get
@@ -186,7 +186,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// stores the data of horizontal offset
/// </summary>
[CategoryAttribute("Horizontal Grid Pattern"), DefaultValueAttribute(0.0), ReadOnlyAttribute(true)]
[Category("Horizontal Grid Pattern"), DefaultValue(0.0), ReadOnly(true)]
public double HorizontalOffset
{
get
@@ -202,7 +202,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// stores how many V lines there are in the grid
/// </summary>
[CategoryAttribute("Horizontal Grid Pattern"), DefaultValueAttribute(0), ReadOnlyAttribute(true)]
[Category("Horizontal Grid Pattern"), DefaultValue(0), ReadOnly(true)]
public int HorizontalLinesNumber
{
get
@@ -218,7 +218,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// stores how many panels there are in the grid
/// </summary>
[CategoryAttribute("Other Data"), DefaultValueAttribute(0), ReadOnlyAttribute(true)]
[Category("Other Data"), DefaultValue(0), ReadOnly(true)]
public int PanelNumber
{
get
@@ -234,7 +234,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// stores how many curtain cells there are in the grid
/// </summary>
[CategoryAttribute("Other Data"), DefaultValueAttribute(0), ReadOnlyAttribute(true)]
[Category("Other Data"), DefaultValue(0), ReadOnly(true)]
public int CellNumber
{
get
@@ -250,7 +250,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// stores how many unlocked panels there are in the grid
/// </summary>
[CategoryAttribute("Other Data"), DefaultValueAttribute(0), ReadOnlyAttribute(true)]
[Category("Other Data"), DefaultValue(0), ReadOnly(true)]
public int UnlockedPanelsNumber
{
get
@@ -266,7 +266,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// stores how many mullions there are in the grid
/// </summary>
[CategoryAttribute("Other Data"), DefaultValueAttribute(0), ReadOnlyAttribute(true)]
[Category("Other Data"), DefaultValue(0), ReadOnly(true)]
public int MullionsNumber
{
get
@@ -282,7 +282,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// stores how many unlocked mullions there are in the grid
/// </summary>
[CategoryAttribute("Other Data"), DefaultValueAttribute(0), ReadOnlyAttribute(true)]
[Category("Other Data"), DefaultValue(0), ReadOnly(true)]
public int UnlockedmullionsNumber
{
get
+23 -14
View File
@@ -38,7 +38,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// maintains all the data used in the sample
/// </summary>
public class MyDocument
public class MyDocument : IDisposable
{
#region Fields
// object which contains reference of Revit Application
@@ -102,7 +102,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
LineOperation m_activeOperation;
// the length unit type for the active Revit document
ForgeTypeId m_LengthUnit;
public ForgeTypeId LengthUnit { get; set; }
// store the message of the sample
private KeyValuePair<string/*msgText*/, bool/*is warningOrError*/> m_message;
@@ -199,14 +199,6 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
}
public ForgeTypeId LengthUnit
{
get
{
return m_LengthUnit;
}
}
/// <summary>
/// store the message of the sample
/// </summary>
@@ -276,11 +268,11 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
try
{
Autodesk.Revit.DB.FormatOptions formatOption = projectUnit.GetFormatOptions(specTypeId);
m_LengthUnit = formatOption.GetUnitTypeId();
LengthUnit = formatOption.GetUnitTypeId();
}
catch (System.Exception /*e*/)
{
m_LengthUnit = UnitTypeId.Feet;
LengthUnit = UnitTypeId.Feet;
}
}
@@ -356,6 +348,23 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
return returns;
}
#endregion
}
#endregion
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (m_wallGeometry != null)
m_wallGeometry.Dispose();
if (LengthUnit != null)
LengthUnit.Dispose();
}
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
}
}
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CurtainWallGrid")]
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -33,3 +33,5 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("windows7.0")]
+16 -1
View File
@@ -32,7 +32,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// maintain the baseline of the curtain wall
/// </summary>
public class WallDrawing
public class WallDrawing : IDisposable
{
#region Fields
// zoom the baseline to a suitable length
@@ -291,5 +291,20 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
new PointF(m_wallLine2D.AssistantPoint.X + 2, m_wallLine2D.AssistantPoint.Y + 2));
}
#endregion
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (m_coordinateFont != null)
m_coordinateFont.Dispose();
}
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
}
}
+17 -2
View File
@@ -34,7 +34,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <summary>
/// the class manages the creation operation for the curtain wall
/// </summary>
public class WallGeometry
public class WallGeometry : IDisposable
{
#region Fields
// the document of this sample
@@ -219,7 +219,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
catch (System.ArgumentException)
{
TaskDialog.Show("Revit", "The start point and the end point of the line are too close, please re-draw it.");
Autodesk.Revit.UI.TaskDialog.Show("Revit", "The start point and the end point of the line are too close, please re-draw it.");
}
Transaction act = new Transaction(m_myDocument.Document);
act.Start(Guid.NewGuid().GetHashCode().ToString());
@@ -233,5 +233,20 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
return wall;
}
#endregion
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (m_drawing != null)
m_drawing.Dispose();
}
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
}// end of class
}