Skip to content

Commit

Permalink
CNX-9441-ETABS-to-Revit-Scaling-Issue (#3410)
Browse files Browse the repository at this point in the history
use updated units call from api

Co-authored-by: Connor Ivy <[email protected]>
  • Loading branch information
connorivy and Connor Ivy authored May 14, 2024
1 parent 3ed07ca commit 630df49
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Objects.Structural.CSI.Analysis;
using System.Linq;
using System;
using Speckle.Core.Logging;

namespace Objects.Converter.CSI;

Expand All @@ -26,14 +27,18 @@ public string ModelUnits()
return _modelUnits;
}

var units = Model.GetPresentUnits();
if (units != 0)
eForce forceUnits = eForce.NotApplicable;
eLength lengthUnits = eLength.NotApplicable;
eTemperature temperatureUnits = eTemperature.NotApplicable;
_ = Model.GetPresentUnits_2(ref forceUnits, ref lengthUnits, ref temperatureUnits);

if (lengthUnits == eLength.NotApplicable)
{
string[] unitsCat = units.ToString().Split('_');
_modelUnits = unitsCat[1];
return _modelUnits;
throw new SpeckleException("Unable to retreive valid length units from the ETABS document");
}
return null;

_modelUnits = lengthUnits.ToString();
return _modelUnits;
}

public double ScaleToNative(double value, string units)
Expand Down

0 comments on commit 630df49

Please sign in to comment.