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
@@ -106,7 +106,7 @@ namespace Revit.SDK.Samples.PathReinforcement.CS
/// </summary>
private String m_primaryBarLength;
#region EnventHanlder for updating selected object of PropertyGrid
#region EventHandler for updating selected object of PropertyGrid
/// <summary>
/// update selected object of Property grid after enable / disable some properties.
/// </summary>
@@ -184,7 +184,7 @@ namespace Revit.SDK.Samples.PathReinforcement.CS
/// Bar numbers of path reinforcement,read only property.
/// the property is read-only by default
/// </summary>
[Category("Layers"), DisplayName("Number of Bars"), ReadOnlyAttribute(true)]
[Category("Layers"), DisplayName("Number of Bars"), ReadOnly(true)]
public int NumberOfBars
{
get
@@ -200,7 +200,7 @@ namespace Revit.SDK.Samples.PathReinforcement.CS
/// <summary>
/// Layout rule of path reinforcement,get/set property.
/// </summary>
[Category("Construction"), DisplayName("Layout Rule"), ReadOnlyAttribute(false)]
[Category("Construction"), DisplayName("Layout Rule"), ReadOnly(false)]
public LayoutRule LayoutRule
{
get
@@ -240,7 +240,7 @@ namespace Revit.SDK.Samples.PathReinforcement.CS
/// <summary>
/// Bar spacing of path reinforcement,get/set property.
/// </summary>
[Category("Layers"), DisplayName("Bar Spacing"), ReadOnlyAttribute(false)]
[Category("Layers"), DisplayName("Bar Spacing"), ReadOnly(false)]
public String BarSpacing
{
get
@@ -340,9 +340,11 @@ namespace Revit.SDK.Samples.PathReinforcement.CS
Type type = typeof(System.ComponentModel.ReadOnlyAttribute);
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(this);
AttributeCollection attrs = props[propertyName].Attributes;
FieldInfo fld = type.GetField("isReadOnly",
BindingFlags.Instance | BindingFlags.NonPublic);
fld.SetValue(attrs[type], readOnly);
FieldInfo fld = type.GetField("<IsReadOnly>k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic);
if (fld != null)
{
fld.SetValue(attrs[type], readOnly);
}
}
catch (System.ArgumentException ex)
{
@@ -1,96 +1,14 @@
<?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>{32B2FD02-DBD6-47EF-8709-C550F4074E64}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Revit.SDK.Samples.PathReinforcement.CS</RootNamespace>
<AssemblyName>PathReinforcement</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>DEBUG;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>
<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>DEBUG;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="BarTypeConverter.cs" />
<Compile Include="MathTools.cs" />
<Compile Include="PathReinforcementForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PathReinforcementForm.Designer.cs">
<DependentUpon>PathReinforcementForm.cs</DependentUpon>
</Compile>
<Compile Include="PathReinProperties.cs" />
<Compile Include="Profile.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="PathReinforcementForm.resx">
<SubType>Designer</SubType>
<DependentUpon>PathReinforcementForm.cs</DependentUpon>
</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>
@@ -36,9 +36,12 @@ namespace Revit.SDK.Samples.PathReinforcement.CS
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
if (disposing)
{
components.Dispose();
if (components != null)
components.Dispose();
if (m_profile != null)
m_profile.Dispose();
}
base.Dispose(disposing);
}
+18 -2
View File
@@ -35,7 +35,7 @@ namespace Revit.SDK.Samples.PathReinforcement.CS
/// <summary>
/// This class stores the geometry information of path reinforcement.
/// </summary>
class Profile
class Profile : IDisposable
{
/// <summary>
/// field used to store path reinforcement.
@@ -62,7 +62,7 @@ namespace Revit.SDK.Samples.PathReinforcement.CS
/// field used to store the bound of the curves of path reinforcement.
/// 2d data.
/// </summary>
private BoundingBoxUV m_box = new BoundingBoxUV();
private BoundingBoxUV m_box;
/// <summary>
/// field used to store the geometry data of curves of path reinforcement.
@@ -82,6 +82,7 @@ namespace Revit.SDK.Samples.PathReinforcement.CS
/// <param name="commandData">External command data</param>
public Profile(Autodesk.Revit.DB.Structure.PathReinforcement pathRein, ExternalCommandData commandData)
{
m_box = new BoundingBoxUV();
m_pathRein = pathRein;
m_commandData = commandData;
Tessellate();
@@ -270,5 +271,20 @@ namespace Revit.SDK.Samples.PathReinforcement.CS
return new Matrix4(new Vector4(vXAxis), new Vector4(vYAxis), new Vector4(vZAxis));
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (m_box != null)
m_box.Dispose();
}
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
}
}
@@ -1,5 +1,5 @@
//
// (C) Copyright 2003-2019 by Autodesk, Inc.
// (C) Copyright 2003-2023 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,
@@ -33,7 +33,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PathReinforcement")]
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -56,3 +56,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")]