Skip to content

Commit

Permalink
Merge pull request #288 from arup-group/bugfix/gsagh-189-order-by-id
Browse files Browse the repository at this point in the history
gsagh-189 sort by descending ID
  • Loading branch information
kpne authored Jan 16, 2023
2 parents 6b0f3c7 + 3e27f0a commit 82fc336
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
11 changes: 6 additions & 5 deletions GsaGH/Helpers/Export/Properties/Prop2ds.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using GsaAPI;
using System;
using System.Collections.Generic;
using GsaGH.Parameters;
using System.Collections.Generic;
using System.Linq;
using static System.Collections.Specialized.BitVector32;
using GsaAPI;
using GsaGH.Parameters;

namespace GsaGH.Helpers.Export
{
Expand Down Expand Up @@ -32,9 +30,12 @@ internal static int ConvertProp2d(GsaProp2d prop2d, ref GsaGuidDictionary<Prop2D
internal static void ConvertProp2d(List<GsaProp2d> prop2Ds, ref GsaGuidDictionary<Prop2D> apiProp2ds, ref GsaGuidDictionary<AnalysisMaterial> apiMaterials)
{
if (prop2Ds != null)
{
prop2Ds = prop2Ds.OrderByDescending(p => p.Id).ToList();
for (int i = 0; i < prop2Ds.Count; i++)
if (prop2Ds[i] != null)
ConvertProp2d(prop2Ds[i], ref apiProp2ds, ref apiMaterials);
}
}
}
}
13 changes: 7 additions & 6 deletions GsaGH/Helpers/Export/Properties/Prop3ds.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using GsaAPI;
using System;
using System.Collections.Generic;
using GsaGH.Parameters;
using System.Collections.Generic;
using System.Linq;
using static System.Collections.Specialized.BitVector32;
using GsaAPI;
using GsaGH.Parameters;

namespace GsaGH.Helpers.Export
{
Expand Down Expand Up @@ -32,9 +30,12 @@ internal static int ConvertProp3d(GsaProp3d prop3d, ref GsaGuidDictionary<Prop3D
internal static void ConvertProp3d(List<GsaProp3d> prop3Ds, ref GsaGuidDictionary<Prop3D> apiProp3ds, ref GsaGuidDictionary<AnalysisMaterial> apiMaterials)
{
if (prop3Ds != null)
{
prop3Ds = prop3Ds.OrderByDescending(p => p.Id).ToList();
for (int i = 0; i < prop3Ds.Count; i++)
if (prop3Ds[i] != null)
ConvertProp3d(prop3Ds[i], ref apiProp3ds, ref apiMaterials);
}
}
}
}
}
12 changes: 6 additions & 6 deletions GsaGH/Helpers/Export/Properties/Sections.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using GsaAPI;
using System;
using System.Collections.Generic;
using GsaGH.Parameters;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using GsaGH.Helpers.Import;
using GsaAPI;
using GsaGH.Parameters;

namespace GsaGH.Helpers.Export
{
Expand Down Expand Up @@ -45,9 +42,12 @@ internal static void ConvertSection(List<GsaSection> sections,
ref GsaGuidDictionary<AnalysisMaterial> apiMaterials)
{
if (sections != null)
{
sections = sections.OrderByDescending(s => s.Id).ToList();
for (int i = 0; i < sections.Count; i++)
if (sections[i] != null)
ConvertSection(sections[i], ref apiSections, ref apiSectionModifiers, ref apiMaterials);
}
}
}
}

0 comments on commit 82fc336

Please sign in to comment.