Skip to content

Commit

Permalink
Fix: AppliedAssembly.AdjustedElevation error, and Single Point Featur…
Browse files Browse the repository at this point in the history
…eline error (#3578)

* Code now defaults AppliedAssembly.AdjustedElevation to double.MinValue if accessing that property throws an error.
Adjusted FeatureLineToSpeckle so it only works on featurelines with more than 2 points, otherwise accessing he spline throws an error

* Switched back to double.NaN

* AdjustedElevation is now a double? type

* Update ConverterAutocadCivil.Civil.cs

---------

Co-authored-by: Claire Kuang <[email protected]>
  • Loading branch information
jhdempsey86 and clairekuang authored Jul 24, 2024
1 parent 885a05b commit fe0c923
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,18 @@ private CivilAppliedAssembly AppliedAssemblyToSpeckle(AppliedAssembly appliedAss
speckleSubassemblies.Add(speckleSubassembly);
}

CivilAppliedAssembly speckleAppliedAssembly = new(speckleSubassemblies, appliedAssembly.AdjustedElevation, ModelUnits);
double? adjustedElevation = null;
try
{
adjustedElevation = appliedAssembly.AdjustedElevation;
}
catch (ArgumentException e) when (!e.IsFatal())
{
// Do nothing. Leave the value as null.
}

CivilAppliedAssembly speckleAppliedAssembly = new(speckleSubassemblies, adjustedElevation, ModelUnits);

return speckleAppliedAssembly;
}

Expand Down
4 changes: 2 additions & 2 deletions Objects/Objects/BuiltElements/Civil/CivilAppliedAssembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public CivilAppliedAssembly() { }

public CivilAppliedAssembly(
List<CivilAppliedSubassembly> appliedSubassemblies,
double adjustedElevation,
double? adjustedElevation,
string units
)
{
Expand All @@ -20,7 +20,7 @@ string units

public List<CivilAppliedSubassembly> appliedSubassemblies { get; set; }

public double adjustedElevation { get; set; }
public double? adjustedElevation { get; set; }

public string units { get; set; }
}

0 comments on commit fe0c923

Please sign in to comment.