updated to Revit 2023 SDK

This commit is contained in:
Jeremy Tammik
2022-04-07 09:12:58 +02:00
parent e3434c5200
commit ab02648986
342 changed files with 6496 additions and 3140 deletions
@@ -21,7 +21,6 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -31,7 +30,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<CodeAnalysisRuleSet />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@@ -40,8 +38,7 @@
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>
</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
@@ -51,8 +48,7 @@
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>
</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
@@ -63,8 +63,8 @@ namespace Revit.SDK.Samples.AddSpaceAndZone.CS
/// </summary>
private void Initialize()
{
Dictionary<int, List<Space>> spaceDictionary = new Dictionary<int, List<Space>>();
Dictionary<int, List<Zone>> zoneDictionary = new Dictionary<int, List<Zone>>();
Dictionary<ElementId, List<Space>> spaceDictionary = new Dictionary<ElementId, List<Space>>();
Dictionary<ElementId, List<Zone>> zoneDictionary = new Dictionary<ElementId, List<Zone>>();
Document activeDoc = m_commandData.Application.ActiveUIDocument.Document;
@@ -79,8 +79,8 @@ namespace Revit.SDK.Samples.AddSpaceAndZone.CS
if (level != null)
{
m_levels.Add(level);
spaceDictionary.Add(level.Id.IntegerValue, new List<Space>());
zoneDictionary.Add(level.Id.IntegerValue, new List<Zone>());
spaceDictionary.Add(level.Id, new List<Space>());
zoneDictionary.Add(level.Id, new List<Zone>());
}
}
@@ -90,7 +90,7 @@ namespace Revit.SDK.Samples.AddSpaceAndZone.CS
Space space = spacesIterator.Current as Space;
if (space != null)
{
spaceDictionary[space.LevelId.IntegerValue].Add(space);
spaceDictionary[space.LevelId].Add(space);
}
}
@@ -100,7 +100,7 @@ namespace Revit.SDK.Samples.AddSpaceAndZone.CS
Zone zone = zonesIterator.Current as Zone;
if (zone != null && activeDoc.GetElement(zone.LevelId) != null)
{
zoneDictionary[zone.LevelId.IntegerValue].Add(zone);
zoneDictionary[zone.LevelId].Add(zone);
}
}
@@ -37,14 +37,14 @@ namespace Revit.SDK.Samples.AddSpaceAndZone.CS
class SpaceManager
{
ExternalCommandData m_commandData;
Dictionary<int, List<Space>> m_spaceDictionary;
Dictionary<ElementId, List<Space>> m_spaceDictionary;
/// <summary>
/// The constructor of SpaceManager class.
/// </summary>
/// <param name="data">The ExternalCommandData</param>
/// <param name="spaceData">The spaceData contains all the Space elements in different level.</param>
public SpaceManager(ExternalCommandData data, Dictionary<int,List<Space>> spaceData)
public SpaceManager(ExternalCommandData data, Dictionary<ElementId,List<Space>> spaceData)
{
m_commandData = data;
m_spaceDictionary = spaceData;
@@ -57,7 +57,7 @@ namespace Revit.SDK.Samples.AddSpaceAndZone.CS
/// <returns>Return a space list</returns>
public List<Space> GetSpaces(Level level)
{
return m_spaceDictionary[level.Id.IntegerValue];
return m_spaceDictionary[level.Id];
}
/// <summary>
@@ -75,7 +75,7 @@ namespace Revit.SDK.Samples.AddSpaceAndZone.CS
Space space = m_commandData.Application.ActiveUIDocument.Document.GetElement(elem) as Space;
if (space != null)
{
m_spaceDictionary[level.Id.IntegerValue].Add(space);
m_spaceDictionary[level.Id].Add(space);
}
}
if (elements == null || elements.Count == 0)
@@ -36,7 +36,7 @@ namespace Revit.SDK.Samples.AddSpaceAndZone.CS
class ZoneManager
{
ExternalCommandData m_commandData;
Dictionary<int, List<Zone>> m_zoneDictionary;
Dictionary<ElementId, List<Zone>> m_zoneDictionary;
Level m_currentLevel;
Zone m_currentZone;
@@ -45,7 +45,7 @@ namespace Revit.SDK.Samples.AddSpaceAndZone.CS
/// </summary>
/// <param name="commandData">The ExternalCommandData</param>
/// <param name="zoneData">The spaceData contains all the Zone elements in different level.</param>
public ZoneManager(ExternalCommandData commandData, Dictionary<int, List<Zone>> zoneData)
public ZoneManager(ExternalCommandData commandData, Dictionary<ElementId, List<Zone>> zoneData)
{
m_commandData = commandData;
m_zoneDictionary = zoneData;
@@ -61,7 +61,7 @@ namespace Revit.SDK.Samples.AddSpaceAndZone.CS
Zone zone = m_commandData.Application.ActiveUIDocument.Document.Create.NewZone(level, phase);
if (zone != null)
{
this.m_zoneDictionary[level.Id.IntegerValue].Add(zone);
this.m_zoneDictionary[level.Id].Add(zone);
}
}
@@ -91,7 +91,7 @@ namespace Revit.SDK.Samples.AddSpaceAndZone.CS
public List<Zone> GetZones(Level level)
{
m_currentLevel = level;
return m_zoneDictionary[level.Id.IntegerValue];
return m_zoneDictionary[level.Id];
}
/// <summary>