Skip to content

Remove Revit 2020 support #1528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions Revit_Core_Adapter/Listener/Files/BHoM_2020.Addin

This file was deleted.

11 changes: 3 additions & 8 deletions Revit_Core_Adapter/Revit_Core_Adapter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,13 @@
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AppendTargetFrameworkToOutputpath>false</AppendTargetFrameworkToOutputpath>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
<Configurations>Debug;Release;Debug2020;Release2020;Debug2021;Release2021;Debug2022;Release2022;Debug2023;Release2023;Debug2024;Release2024;Debug2025;Release2025</Configurations>
<Configurations>Debug;Release;Debug2021;Release2021;Debug2022;Release2022;Debug2023;Release2023;Debug2024;Release2024;Debug2025;Release2025</Configurations>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
<RevitVersion>2020</RevitVersion>
<TargetFramework>net48</TargetFramework>
<DefineConstants>REVIT2020</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(Configuration.Contains('2020'))">
<RevitVersion>2020</RevitVersion>
<RevitVersion>2021</RevitVersion>
<TargetFramework>net48</TargetFramework>
<DefineConstants>REVIT2020</DefineConstants>
<DefineConstants>REVIT2021</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(Configuration.Contains('2021'))">
<RevitVersion>2021</RevitVersion>
Expand Down
4 changes: 0 additions & 4 deletions Revit_Core_Engine/Convert/FromSI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ public static partial class Convert
[Input("value", "Numerical value to be converted to BHoM-specific units.")]
[Input("quantity", "Quantity type to use when converting from Revit internal units to BHoM-specific units.")]
[Output("converted", "Input value converted from internal Revit units to BHoM-specific units for the input quantity type.")]
#if (REVIT2020)
public static double FromSI(this double value, UnitType quantity)
#else
public static double FromSI(this double value, ForgeTypeId quantity)
#endif
{
if (double.IsNaN(value) || value == double.MaxValue || value == double.MinValue || double.IsNegativeInfinity(value) || double.IsPositiveInfinity(value))
return value;
Expand Down
4 changes: 2 additions & 2 deletions Revit_Core_Engine/Convert/Physical/ToRevit/Floor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static Floor ToRevitFloor(this oM.Physical.Elements.Floor floor, Document
BH.oM.Geometry.Plane slabPlane = planarSurface.FitPlane();
if (1 - Math.Abs(Vector.ZAxis.DotProduct(slabPlane.Normal)) <= settings.AngleTolerance)
{
#if (REVIT2020 || REVIT2021)
#if REVIT2021
if (floorType.Category.Id.IntegerValue == (int)BuiltInCategory.OST_StructuralFoundation)
revitFloor = document.Create.NewFoundationSlab(curve.ToRevitCurveArray(), floorType, level, true, XYZ.BasisZ);
else
Expand All @@ -103,7 +103,7 @@ public static Floor ToRevitFloor(this oM.Physical.Elements.Floor floor, Document
XYZ start = ln.ClosestPoint(curve.IStartPoint(), true).ToRevit();
Autodesk.Revit.DB.Line line = Autodesk.Revit.DB.Line.CreateBound(start, start + dir);

#if (REVIT2020 || REVIT2021)
#if REVIT2021
revitFloor = document.Create.NewSlab(curve.ToRevitCurveArray(), level, line, -tan, true);
#else
revitFloor = Floor.Create(document, new List<CurveLoop> { curve.ToRevitCurveLoop() }, floorType.Id, level.Id, true, line, -tan);
Expand Down
2 changes: 1 addition & 1 deletion Revit_Core_Engine/Convert/Structure/FromRevit/Bars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static List<Bar> BarsFromRevit(this FamilyInstance familyInstance, RevitS

// Get bar curve
List<oM.Geometry.ICurve> locationCurves = null;
#if (REVIT2020 || REVIT2021 || REVIT2022)
#if (REVIT2021 || REVIT2022)
AnalyticalModelStick analyticalModel = familyInstance.GetAnalyticalModel() as AnalyticalModelStick;
if (analyticalModel != null)
{
Expand Down
2 changes: 1 addition & 1 deletion Revit_Core_Engine/Convert/Structure/FromRevit/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ private static BH.oM.Geometry.Line MullionLine(this Mullion mullion)
/**** Private helpers ****/
/***************************************************/

#if REVIT2020 || REVIT2021 || REVIT2022 || REVIT2023 || REVIT2024
#if REVIT2021 || REVIT2022 || REVIT2023 || REVIT2024
private static readonly BuiltInParameterGroup[] dimensionGroups = { GroupTypeId.StructuralSectionGeometry, GroupTypeId.Geometry };
#else
private static readonly ForgeTypeId[] dimensionGroups = { GroupTypeId.StructuralSectionGeometry, GroupTypeId.Geometry };
Expand Down
4 changes: 0 additions & 4 deletions Revit_Core_Engine/Convert/ToSI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ public static partial class Convert
[Input("value", "Numerical value to be converted to internal Revit units.")]
[Input("quantity", "Quantity type to use when converting from BHoM-specific units to Revit internal units.")]
[Output("converted", "Input value converted from BHoM-specific units to internal Revit units for the input quantity type.")]
#if (REVIT2020)
public static double ToSI(this double value, UnitType quantity)
#else
public static double ToSI(this double value, ForgeTypeId quantity)
#endif
{
if (double.IsNaN(value) || value == double.MaxValue || value == double.MinValue || double.IsNegativeInfinity(value) || double.IsPositiveInfinity(value))
return value;
Expand Down
4 changes: 2 additions & 2 deletions Revit_Core_Engine/Create/Definition/Parameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static partial class Create
[Output("definition", "Revit parameter Definition created based on the input properties.")]
public static Definition Parameter(Document document, string parameterName, string typeName, string groupName, bool instance, IEnumerable<string> categoryNames, bool shared, string discipline = "")
{
#if REVIT2020 || REVIT2021 || REVIT2022
#if REVIT2021 || REVIT2022
List<ParameterType> parameterTypes = new List<ParameterType>();
foreach (ParameterType pt in Enum.GetValues(typeof(ParameterType)))
{
Expand Down Expand Up @@ -117,7 +117,7 @@ public static Definition Parameter(Document document, string parameterName, stri
return Create.SharedParameter(document, parameterName, parameterType, groupName, instance, categories);
else
{
#if REVIT2020 || REVIT2021 || REVIT2022 || REVIT2023 || REVIT2024
#if REVIT2021 || REVIT2022 || REVIT2023 || REVIT2024
BuiltInParameterGroup parameterGroup = groupName.GroupFromName();
if (parameterGroup == BuiltInParameterGroup.INVALID)
#else
Expand Down
2 changes: 1 addition & 1 deletion Revit_Core_Engine/Create/Definition/ProjectParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static partial class Create
[Input("instance", "If true, the created parameter will be an instance parameter, otherwise it will be a type parameter.")]
[Input("categories", "Categories, to which the created parameter is bound. It will get bound to all categories if this value is null.")]
[Output("definition", "Revit project parameter Definition created based on the input properties.")]
#if REVIT2020 || REVIT2021 || REVIT2022
#if REVIT2021 || REVIT2022
public static Definition ProjectParameter(Document document, string parameterName, ParameterType parameterType, BuiltInParameterGroup parameterGroup, bool instance, IEnumerable<Category> categories)
#elif REVIT2023 || REVIT2024
public static Definition ProjectParameter(Document document, string parameterName, ForgeTypeId parameterType, BuiltInParameterGroup parameterGroup, bool instance, IEnumerable<Category> categories)
Expand Down
2 changes: 1 addition & 1 deletion Revit_Core_Engine/Create/Definition/SharedParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static partial class Create
[Input("instance", "If true, the created parameter will be an instance parameter, otherwise it will be a type parameter.")]
[Input("categories", "Categories, to which the created parameter is bound. It will get bound to all categories if this value is null.")]
[Output("definition", "Revit shared parameter Definition created based on the input properties.")]
#if REVIT2020 || REVIT2021 || REVIT2022
#if REVIT2021 || REVIT2022
public static Definition SharedParameter(Document document, string parameterName, ParameterType parameterType, string parameterGroup, bool instance, IEnumerable<Category> categories)
#else
public static Definition SharedParameter(Document document, string parameterName, ForgeTypeId parameterType, string parameterGroup, bool instance, IEnumerable<Category> categories)
Expand Down
8 changes: 1 addition & 7 deletions Revit_Core_Engine/Objects/GroupTypeId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

#if REVIT2020 || REVIT2021 || REVIT2022 || REVIT2023 || REVIT2024
#if REVIT2021 || REVIT2022 || REVIT2023 || REVIT2024
using Autodesk.Revit.DB;
using BH.oM.Base.Attributes;

Expand Down Expand Up @@ -147,12 +147,6 @@ public static class GroupTypeId
public static BuiltInParameterGroup ViewExtents { get { return BuiltInParameterGroup.PG_VIEW_EXTENTS; } }
public static BuiltInParameterGroup Visibility { get { return BuiltInParameterGroup.PG_VISIBILITY; } }

public static BuiltInParameterGroup AlternateUnits { [NotImplemented] get { return NonExistent(nameof(AlternateUnits), 2020); } }
public static BuiltInParameterGroup ElectricalAnalysis { [NotImplemented] get { return NonExistent(nameof(ElectricalAnalysis), 2020); } }
public static BuiltInParameterGroup ElectricalEngineering { [NotImplemented] get { return NonExistent(nameof(ElectricalEngineering), 2020); } }
public static BuiltInParameterGroup PrimaryUnits { [NotImplemented] get { return NonExistent(nameof(PrimaryUnits), 2020); } }
public static BuiltInParameterGroup Termination { [NotImplemented] get { return NonExistent(nameof(Termination), 2020); } }

public static BuiltInParameterGroup LifeSafety { [NotImplemented] get { return NonExistent(nameof(LifeSafety), 2022); } }
public static BuiltInParameterGroup StructuralSectionDimensions { [NotImplemented] get { return NonExistent(nameof(StructuralSectionDimensions), 2022); } }
public static BuiltInParameterGroup ToposolidSubdivision { [NotImplemented] get { return NonExistent(nameof(ToposolidSubdivision), 2022); } }
Expand Down
Loading