mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-09-25 20:27:01 +00:00
integrate Revit 2025 SDK
This commit is contained in:
+5
-2
@@ -36,9 +36,12 @@ namespace Revit.SDK.Samples.CreateBeamSystem.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_sketch != null)
|
||||
m_sketch.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace Revit.SDK.Samples.CreateBeamSystem.CS
|
||||
/// properties related to LayoutRule when it's clear spacing
|
||||
/// only visible for class BeamSystemParam
|
||||
/// </summary>
|
||||
class ClearSpacingParam : BeamSystemParam
|
||||
class ClearSpacingParam : BeamSystemParam, IDisposable
|
||||
{
|
||||
protected LayoutRuleClearSpacing m_layout;
|
||||
|
||||
@@ -283,13 +283,28 @@ namespace Revit.SDK.Samples.CreateBeamSystem.CS
|
||||
m_layout = new LayoutRuleClearSpacing(m_fixedSpacing, m_justifyType);
|
||||
m_layoutType = LayoutMethod.ClearSpacing;
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (m_layout != null)
|
||||
m_layout.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(disposing: true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// properties related to LayoutRule when it's fixed distance
|
||||
/// only visible for class BeamSystemParam
|
||||
/// </summary>
|
||||
class FixedDistanceParam : BeamSystemParam
|
||||
class FixedDistanceParam : BeamSystemParam, IDisposable
|
||||
{
|
||||
protected LayoutRuleFixedDistance m_layout;
|
||||
|
||||
@@ -357,13 +372,28 @@ namespace Revit.SDK.Samples.CreateBeamSystem.CS
|
||||
m_justifyType = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (m_layout != null)
|
||||
m_layout.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(disposing: true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// properties related to LayoutRule when it's fixed number
|
||||
/// only visible for class BeamSystemParam
|
||||
/// </summary>
|
||||
class FixedNumberParam : BeamSystemParam
|
||||
class FixedNumberParam : BeamSystemParam, IDisposable
|
||||
{
|
||||
protected LayoutRuleFixedNumber m_layout;
|
||||
|
||||
@@ -411,13 +441,28 @@ namespace Revit.SDK.Samples.CreateBeamSystem.CS
|
||||
m_layout = new LayoutRuleFixedNumber(m_numberOfLines);
|
||||
m_layoutType = LayoutMethod.FixedNumber;
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (m_layout != null)
|
||||
m_layout.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(disposing: true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// properties related to LayoutRule when it's maximum spacing
|
||||
/// only visible for class BeamSystemParam
|
||||
/// </summary>
|
||||
class MaximumSpacingParam : BeamSystemParam
|
||||
class MaximumSpacingParam : BeamSystemParam, IDisposable
|
||||
{
|
||||
protected LayoutRuleMaximumSpacing m_layout;
|
||||
|
||||
@@ -465,6 +510,21 @@ namespace Revit.SDK.Samples.CreateBeamSystem.CS
|
||||
m_layout = new LayoutRuleMaximumSpacing(m_fixedSpacing);
|
||||
m_layoutType = LayoutMethod.MaximumSpacing;
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (m_layout != null)
|
||||
m_layout.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(disposing: true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,5 +185,14 @@ namespace Revit.SDK.Samples.CreateBeamSystem.CS
|
||||
|
||||
return plgpts;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (m_inverse != null)
|
||||
m_inverse.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,11 +45,6 @@ namespace Revit.SDK.Samples.CreateBeamSystem.CS
|
||||
/// </summary>
|
||||
protected Dictionary<string, FamilySymbol> m_hash;
|
||||
|
||||
/// <summary>
|
||||
/// subclass must implement to initialize m_hash
|
||||
/// </summary>
|
||||
public abstract void GetConvertHash();
|
||||
|
||||
/// <summary>
|
||||
/// returns whether this object supports a standard set of values that can be picked from a list
|
||||
/// </summary>
|
||||
@@ -140,14 +135,6 @@ namespace Revit.SDK.Samples.CreateBeamSystem.CS
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// constructor initialize m_hash
|
||||
/// </summary>
|
||||
protected ParameterConverter()
|
||||
{
|
||||
GetConvertHash();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -157,11 +144,9 @@ namespace Revit.SDK.Samples.CreateBeamSystem.CS
|
||||
/// </summary>
|
||||
public class BeamTypeItem : ParameterConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// override the base type's GetConvertHash method
|
||||
/// </summary>
|
||||
public override void GetConvertHash()
|
||||
{
|
||||
public BeamTypeItem()
|
||||
: base()
|
||||
{
|
||||
m_hash = BeamSystemData.GetBeamTypes();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,114 +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>{205E158D-9960-489D-A391-4804D9D3F8DC}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Revit.SDK.Samples.CreateBeamSystem.CS</RootNamespace>
|
||||
<AssemblyName>CreateBeamSystem</AssemblyName>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<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>
|
||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||
<CodeAnalysisRules>-Microsoft.Globalization#CA1301;-Microsoft.Globalization#CA1302;-Microsoft.Globalization#CA1303;-Microsoft.Globalization#CA1306;-Microsoft.Globalization#CA1304;-Microsoft.Globalization#CA1305;-Microsoft.Globalization#CA1300;-Microsoft.Interoperability#CA1403;-Microsoft.Interoperability#CA1406;-Microsoft.Interoperability#CA1413;-Microsoft.Interoperability#CA1402;-Microsoft.Interoperability#CA1407;-Microsoft.Interoperability#CA1404;-Microsoft.Interoperability#CA1410;-Microsoft.Interoperability#CA1411;-Microsoft.Interoperability#CA1405;-Microsoft.Interoperability#CA1409;-Microsoft.Interoperability#CA1415;-Microsoft.Interoperability#CA1408;-Microsoft.Interoperability#CA1414;-Microsoft.Interoperability#CA1412;-Microsoft.Interoperability#CA1400;-Microsoft.Interoperability#CA1401;-Microsoft.Mobility#CA1600;-Microsoft.Mobility#CA1601;-Microsoft.Portability#CA1901;-Microsoft.Portability#CA1900</CodeAnalysisRules>
|
||||
</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>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRules>-Microsoft.Globalization#CA1301;-Microsoft.Globalization#CA1302;-Microsoft.Globalization#CA1303;-Microsoft.Globalization#CA1306;-Microsoft.Globalization#CA1304;-Microsoft.Globalization#CA1305;-Microsoft.Globalization#CA1300;-Microsoft.Interoperability#CA1403;-Microsoft.Interoperability#CA1406;-Microsoft.Interoperability#CA1413;-Microsoft.Interoperability#CA1402;-Microsoft.Interoperability#CA1407;-Microsoft.Interoperability#CA1404;-Microsoft.Interoperability#CA1410;-Microsoft.Interoperability#CA1411;-Microsoft.Interoperability#CA1405;-Microsoft.Interoperability#CA1409;-Microsoft.Interoperability#CA1415;-Microsoft.Interoperability#CA1408;-Microsoft.Interoperability#CA1414;-Microsoft.Interoperability#CA1412;-Microsoft.Interoperability#CA1400;-Microsoft.Interoperability#CA1401;-Microsoft.Mobility#CA1600;-Microsoft.Mobility#CA1601;-Microsoft.Portability#CA1901;-Microsoft.Portability#CA1900</CodeAnalysisRules>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</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="BeamSystemBuilder.cs" />
|
||||
<Compile Include="BeamSystemData.cs" />
|
||||
<Compile Include="BeamSystemForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BeamSystemForm.Designer.cs">
|
||||
<DependentUpon>BeamSystemForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BeamSystemParams.cs" />
|
||||
<Compile Include="BeamSystemSketch.cs" />
|
||||
<Compile Include="BeamTypeConverter.cs" />
|
||||
<Compile Include="Command.cs" />
|
||||
<Compile Include="ErrorMessageException.cs" />
|
||||
<Compile Include="Line2D.cs" />
|
||||
<Compile Include="GeometryUtil.cs" />
|
||||
<Compile Include="LineSketch.cs" />
|
||||
<Compile Include="ObjectSketch.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="BeamSystemForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>BeamSystemForm.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>
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Revit.SDK.Samples.CreateBeamSystem.CS
|
||||
/// <summary>
|
||||
/// base class of sketch object to draw 2D geometry object
|
||||
/// </summary>
|
||||
public abstract class ObjectSketch
|
||||
public abstract class ObjectSketch : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// bounding box of the geometry object
|
||||
@@ -71,5 +71,22 @@ namespace Revit.SDK.Samples.CreateBeamSystem.CS
|
||||
/// <param name="g"></param>
|
||||
/// <param name="translate"></param>
|
||||
public abstract void Draw(Graphics g, Matrix translate);
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (m_pen != null)
|
||||
m_pen.Dispose();
|
||||
if (m_transform != null)
|
||||
m_transform.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("CreateBeamSystem")]
|
||||
[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")]
|
||||
|
||||
Reference in New Issue
Block a user