From 600ffd910ff9e007869bb1a4f6c8f65d3bf6ac94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Tue, 22 Oct 2024 16:03:55 +0200 Subject: [PATCH 1/2] Populating orientationAngle CrossSectionRotation parameters of Revit analytical sticks were not assigned to Element1D.orientationAngle, hence not being received in ETABS. --- .../ConverterCSIShared/PartialClasses/Geometry/ConvertFrame.cs | 2 +- .../PartialClasses/ConvertAnalyticalStick.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Objects/Converters/ConverterCSI/ConverterCSIShared/PartialClasses/Geometry/ConvertFrame.cs b/Objects/Converters/ConverterCSI/ConverterCSIShared/PartialClasses/Geometry/ConvertFrame.cs index ac1d02a656..606f2d0403 100644 --- a/Objects/Converters/ConverterCSI/ConverterCSIShared/PartialClasses/Geometry/ConvertFrame.cs +++ b/Objects/Converters/ConverterCSI/ConverterCSIShared/PartialClasses/Geometry/ConvertFrame.cs @@ -340,7 +340,7 @@ public void SetFrameElementProperties(Element1D element1D, string newFrame, ILis if (element1D.orientationAngle != null) { - Model.FrameObj.SetLocalAxes(newFrame, element1D.orientationAngle); + Model.FrameObj.SetLocalAxes(newFrame, element1D.orientationAngle * (180 / Math.PI)); // Convert from radians to degrees } end1Release = end1Release.Select(b => !b).ToArray(); end2Release = end2Release.Select(b => !b).ToArray(); diff --git a/Objects/Converters/ConverterRevit/ConverterRevitShared/PartialClasses/ConvertAnalyticalStick.cs b/Objects/Converters/ConverterRevit/ConverterRevitShared/PartialClasses/ConvertAnalyticalStick.cs index 2da7027efe..90f53ae427 100644 --- a/Objects/Converters/ConverterRevit/ConverterRevitShared/PartialClasses/ConvertAnalyticalStick.cs +++ b/Objects/Converters/ConverterRevit/ConverterRevitShared/PartialClasses/ConvertAnalyticalStick.cs @@ -289,6 +289,8 @@ private Element1D AnalyticalStickToSpeckle(AnalyticalModelStick revitStick) speckleElement1D.end1Offset = VectorToSpeckle(startOffset, revitStick.Document); speckleElement1D.end2Offset = VectorToSpeckle(endOffset, revitStick.Document); + speckleElement1D.orientationAngle = revitStick.get_Parameter(BuiltInParameter.ANALYTICAL_MODEL_ROTATION)?.AsDouble() ?? 0.0; // Default to 0.0 if null or parameter not found, in radians + SetEndReleases(revitStick, ref speckleElement1D); var prop = new Property1D(); @@ -360,6 +362,7 @@ private Element1D AnalyticalStickToSpeckle(AnalyticalMember revitStick) } speckleElement1D.baseLine = CurveToSpeckle(revitStick.GetCurve(), revitStick.Document) as Objects.Geometry.Line; + speckleElement1D.orientationAngle = revitStick?.CrossSectionRotation ?? 0; // In radians SetEndReleases(revitStick, ref speckleElement1D); From 2bd924c10ee1bd425f6d7850c7db2924fddc2b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Wed, 30 Oct 2024 17:22:26 +0100 Subject: [PATCH 2/2] Radians internal units --- .../Models/Element1DAnalyticalResultConverter.cs | 2 +- .../ConverterCSI/ConverterCSIShared/Models/ResultsConverter.cs | 1 + .../ConverterCSIShared/PartialClasses/Geometry/ConvertFrame.cs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Objects/Converters/ConverterCSI/ConverterCSIShared/Models/Element1DAnalyticalResultConverter.cs b/Objects/Converters/ConverterCSI/ConverterCSIShared/Models/Element1DAnalyticalResultConverter.cs index 5c120422cc..5a48332321 100644 --- a/Objects/Converters/ConverterCSI/ConverterCSIShared/Models/Element1DAnalyticalResultConverter.cs +++ b/Objects/Converters/ConverterCSI/ConverterCSIShared/Models/Element1DAnalyticalResultConverter.cs @@ -135,7 +135,7 @@ ref m3 numberOfResults, null, loadCase, - (int i) => (float)(objSta[i] / lengthOf1dElement), + (int i) => (float)(objSta[i] / lengthOf1dElement), // Dangerous. We are not validating if lengthOf1dElement != 0 p, v2, v3, diff --git a/Objects/Converters/ConverterCSI/ConverterCSIShared/Models/ResultsConverter.cs b/Objects/Converters/ConverterCSI/ConverterCSIShared/Models/ResultsConverter.cs index 08fe96942d..e0df7821dc 100644 --- a/Objects/Converters/ConverterCSI/ConverterCSIShared/Models/ResultsConverter.cs +++ b/Objects/Converters/ConverterCSI/ConverterCSIShared/Models/ResultsConverter.cs @@ -143,6 +143,7 @@ public static void SetLoadCombinationsForResults(cSapModel sapModel, Dictionary< loadCasesCommaSeparated = string.Empty; } + // This approach is NOT ideal. What if the load combination name has a comma in it? string[] loadCases = loadCasesCommaSeparated.Split(',').Select(s => s.TrimStart()).ToArray(); var numberOfLoadCombinations = 0; diff --git a/Objects/Converters/ConverterCSI/ConverterCSIShared/PartialClasses/Geometry/ConvertFrame.cs b/Objects/Converters/ConverterCSI/ConverterCSIShared/PartialClasses/Geometry/ConvertFrame.cs index 606f2d0403..84435b3a0d 100644 --- a/Objects/Converters/ConverterCSI/ConverterCSIShared/PartialClasses/Geometry/ConvertFrame.cs +++ b/Objects/Converters/ConverterCSI/ConverterCSIShared/PartialClasses/Geometry/ConvertFrame.cs @@ -338,7 +338,7 @@ public void SetFrameElementProperties(Element1D element1D, string newFrame, ILis Model.FrameObj.SetSection(newFrame, propertyName); } - if (element1D.orientationAngle != null) + if (element1D.orientationAngle != 0) { Model.FrameObj.SetLocalAxes(newFrame, element1D.orientationAngle * (180 / Math.PI)); // Convert from radians to degrees }