diff --git a/GsaGH/Components/6_Display/ResultDiagrams.cs b/GsaGH/Components/6_Display/ResultDiagrams.cs index 7cc3bb945..39dc380a5 100644 --- a/GsaGH/Components/6_Display/ResultDiagrams.cs +++ b/GsaGH/Components/6_Display/ResultDiagrams.cs @@ -264,14 +264,14 @@ public class ResultDiagrams : GH_OasysDropDownComponent { GraphicDrawResult diagramResults = result.Model.Model.GetDiagrams(graphic); ReadOnlyCollection linesFromModel = diagramResults.Lines; - Color color = Color.Empty; - da.GetData(4, ref color); - - double lengthScaleFactor = UnitConverter.Convert(1, Length.BaseUnit, lengthUnit); - bool doubleArrow = false; bool isDisplacement = false; if (_selectedItems[0] == "Displacement") { isDisplacement = true; + } + + Color color = Color.Empty; + bool doubleArrow = false; + if (!da.GetData(4, ref color) && isDisplacement) { if (IsTranslation()) { color = Color.FromArgb(102, 220, 103); } else { @@ -280,6 +280,8 @@ public class ResultDiagrams : GH_OasysDropDownComponent { } } + double lengthScaleFactor = UnitConverter.Convert(1, Length.BaseUnit, lengthUnit); + foreach (Line item in linesFromModel) { if (isDisplacement) { var anchor = new Point3d(item.Start.X, item.Start.Y, item.Start.Z); diff --git a/GsaGHTests/1_BaseParameters/2_Geometry/GsaMember2dTest.cs b/GsaGHTests/1_BaseParameters/2_Geometry/GsaMember2dTest.cs index bd1da7e2f..1da6006b6 100644 --- a/GsaGHTests/1_BaseParameters/2_Geometry/GsaMember2dTest.cs +++ b/GsaGHTests/1_BaseParameters/2_Geometry/GsaMember2dTest.cs @@ -6,6 +6,7 @@ using Rhino.Geometry; using Xunit; using LengthUnit = OasysUnits.Units.LengthUnit; +using Polyline = Rhino.Geometry.Polyline; namespace GsaGHTests.Parameters { [Collection("GrasshopperFixture collection")]