Skip to content

Commit 4050f9f

Browse files
IsakNaslundBhFraser Greenroyd
authored andcommitted
Align with changes in Structure_Engine
1 parent 20fb500 commit 4050f9f

File tree

5 files changed

+22
-13
lines changed

5 files changed

+22
-13
lines changed

MidasCivil_Adapter/Convert/ToBHoM/Elements/ToBar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static Bar ToBar(this string bar, Dictionary<string, Node> bhomNodes,
9494

9595
double orientationAngle = double.Parse(delimitted[6].Trim());
9696

97-
Bar bhomBar = Engine.Structure.Create.Bar(startNode, endNode, sectionProperty, orientationAngle, barRelease, feaType);
97+
Bar bhomBar = new Bar { StartNode = startNode, EndNode = endNode, SectionProperty = sectionProperty, OrientationAngle = orientationAngle, Release = barRelease, FEAType = feaType };
9898
bhomBar.SetAdapterId(typeof(MidasCivilId), bhomID);
9999

100100
return bhomBar;

MidasCivil_Adapter/Convert/ToBHoM/Elements/ToNode.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,15 @@ public static Node ToNode(this string node, Dictionary<string, Constraint6DOF> s
4141
{
4242
List<string> delimitted = node.Split(',').ToList();
4343

44-
Node bhomNode = Engine.Structure.Create.Node(
45-
new Point
44+
Node bhomNode = new Node
45+
{
46+
Position = new Point
4647
{
4748
X = double.Parse(delimitted[1].Trim()).LengthToSI(lengthUnit),
4849
Y = double.Parse(delimitted[2].Trim()).LengthToSI(lengthUnit),
4950
Z = double.Parse(delimitted[3].Trim()).LengthToSI(lengthUnit)
5051
}
51-
);
52+
};
5253

5354
bhomNode.SetAdapterId(typeof(MidasCivilId), delimitted[0].Trim());
5455
int bhomID = bhomNode.AdapterId<int>(typeof(MidasCivilId));

MidasCivil_Adapter/Convert/ToBHoM/Elements/ToRigidLink.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static RigidLink ToRigidLink(string rigidLink, Dictionary<string, Node> n
7676
name = delimitted[4].Trim();
7777
}
7878

79-
RigidLink bhomRigidLink = Engine.Structure.Create.RigidLink(primaryNode, secondaryNodes, constraint);
79+
RigidLink bhomRigidLink = new RigidLink { PrimaryNode = primaryNode, SecondaryNodes = secondaryNodes, Constraint = constraint };
8080
bhomRigidLink.Name = name;
8181
bhomRigidLink.SetAdapterId(typeof(MidasCivilId), name);
8282

MidasCivil_Adapter/Convert/ToBHoM/Properties/ToBarRelease.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static BarRelease ToBarRelease(string release, int count)
6666
releaseName = "BR" + count.ToString();
6767
}
6868

69-
BarRelease bhomBarRelease = Engine.Structure.Create.BarRelease(startConstraint, endConstraint, releaseName);
69+
BarRelease bhomBarRelease = new BarRelease { StartRelease = startConstraint, EndRelease = endConstraint, Name = releaseName };
7070
bhomBarRelease.SetAdapterId(typeof(MidasCivilId), bhomBarRelease.Name);
7171

7272
return bhomBarRelease;

MidasCivil_Adapter/Convert/ToBHoM/Properties/ToSurfaceProperty.cs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,25 @@ public static ISurfaceProperty ToSurfaceProperty(this string surfaceProperty, st
4242
{
4343
case "8.9.5":
4444
case "8.9.0":
45-
constantThickness = Engine.Structure.Create.ConstantThickness(
46-
System.Convert.ToDouble(split[4].Trim()).LengthToSI(lengthUnit), null, "t = " + split[4].Trim());
45+
constantThickness = new ConstantThickness
46+
{
47+
Thickness = System.Convert.ToDouble(split[4].Trim()).LengthToSI(lengthUnit),
48+
Name = "t = " + split[4].Trim()
49+
};
4750
break;
4851
case "8.8.5":
49-
constantThickness = Engine.Structure.Create.ConstantThickness(
50-
System.Convert.ToDouble(split[4].Trim()).LengthToSI(lengthUnit), null, split[1]);
52+
constantThickness =new ConstantThickness
53+
{
54+
Thickness = System.Convert.ToDouble(split[4].Trim()).LengthToSI(lengthUnit),
55+
Name = split[1]
56+
};
5157
break;
5258
default:
53-
constantThickness = Engine.Structure.Create.ConstantThickness(
54-
System.Convert.ToDouble(split[3].Trim()).LengthToSI(lengthUnit));
55-
constantThickness.Name = "t = " + split[3].Trim();
59+
constantThickness = new ConstantThickness
60+
{
61+
Thickness = System.Convert.ToDouble(split[3].Trim()).LengthToSI(lengthUnit),
62+
Name = "t = " + split[3].Trim()
63+
};
5664
break;
5765
}
5866

0 commit comments

Comments
 (0)