diff --git a/GSA_Adapter/CRUD/Create.cs b/GSA_Adapter/CRUD/Create.cs index 94dfb9d3..400ebf22 100644 --- a/GSA_Adapter/CRUD/Create.cs +++ b/GSA_Adapter/CRUD/Create.cs @@ -35,6 +35,7 @@ using BH.oM.Adapters.GSA.SurfaceProperties; using BH.oM.Structure.MaterialFragments; using BH.oM.Structure.Fragments; +using BH.oM.Adapters.GSA.Elements; namespace BH.Adapter.GSA { @@ -159,32 +160,47 @@ private bool CreateObject(ISectionProperty prop) // private bool CreateLinks(IEnumerable links) { - bool success = true; - foreach (RigidLink link in links) - { - success &= ComCall(Convert.ToGsaString(link, GetAdapterId(link).ToString(), 0)); - } foreach (RigidLink link in links) { - List allIds = new List(); - for (int i = 1; i < link.SecondaryNodes.Count; i++) + if (Convert.CheckRigCon(link) == false) { - int id = (int)NextFreeId(link.GetType(), i == 1); - success &= ComCall(Convert.ToGsaString(link, id.ToString(), i)); - allIds.Add(id); + if (link.SecondaryNodes.Count > 1) + { + List secondaryIds = new List(); + foreach (Node secondaryNode in link.SecondaryNodes) + { + int id = (int)NextFreeId(link.GetType(), false); + int secondaryIndex = link.SecondaryNodes.IndexOf(secondaryNode); + success &= ComCall(Convert.ToGsaString(link, id.ToString(), secondaryIndex)); + secondaryIds.Add(id); + } + + var allIds = new List { GetAdapterId(link) }; + allIds.AddRange(secondaryIds); + link.Fragments.Remove(typeof(GSAId)); + link.SetAdapterId(typeof(GSAId), allIds); + } + else + { + int id = (int)NextFreeId(link.GetType(), false); + success &= ComCall(Convert.ToGsaString(link, id.ToString())); + link.Fragments.Remove(typeof(GSAId)); + link.SetAdapterId(typeof(GSAId), id); + } } - if (link.SecondaryNodes.Count > 1) + else { - allIds.Insert(0, GetAdapterId(link)); - link.Fragments.Remove(typeof(GSAId)); // to remove the existing single id on the link - link.SetAdapterId(typeof(GSAId), allIds); + success &= ComCall(Convert.ToGsaString(link, GetAdapterId(link).ToString())); } } + return success; } + + /***************************************************/ private bool CreateFEMesh(FEMesh mesh) @@ -278,6 +294,7 @@ private bool CreateObject(FabricPanelProperty fabricProperty) /***************************************************/ + } } diff --git a/GSA_Adapter/CRUD/Read.cs b/GSA_Adapter/CRUD/Read.cs index 7e817a77..018231d7 100644 --- a/GSA_Adapter/CRUD/Read.cs +++ b/GSA_Adapter/CRUD/Read.cs @@ -404,11 +404,14 @@ public List ReadRigidLink(List ids = null) Dictionary constraints = GetCachedOrReadAsDictionary(); Dictionary nodes = GetCachedOrReadAsDictionary(); + string allConstr = m_gsaCom.GwaCommand("GET_ALL, RIGID").ToString(); + string[] constrArr = string.IsNullOrWhiteSpace(allConstr) ? new string[0] : allConstr.Split('\n'); + int[] potentialBeamRefs = GenerateIndices(ids, typeof(RigidLink)); GsaElement[] gsaElements = new GsaElement[potentialBeamRefs.Length]; m_gsaCom.Elements(potentialBeamRefs, out gsaElements); - return Convert.FromGsaRigidLinks(gsaElements, constraints, nodes); + return Convert.FromGsaRigidLinks(gsaElements, constrArr, constraints, nodes); //if (ids == null) // return proArr.Select(x => Convert.FromGsaSectionProperty(x, materials)).ToList(); diff --git a/GSA_Adapter/Convert/FromGsa/Elements/RigidConstraint.cs b/GSA_Adapter/Convert/FromGsa/Elements/RigidConstraint.cs new file mode 100644 index 00000000..6e8b365e --- /dev/null +++ b/GSA_Adapter/Convert/FromGsa/Elements/RigidConstraint.cs @@ -0,0 +1,101 @@ +/* + * This file is part of the Buildings and Habitats object Model (BHoM) + * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * + * Each contributor holds copyright over their respective contributions. + * The project versioning (Git) records all such contribution source information. + * + * + * The BHoM is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3.0 of the License, or + * (at your option) any later version. + * + * The BHoM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this code. If not, see . + */ + +#if GSA_10_1 +using Interop.Gsa_10_1; +#else +using Interop.gsa_8_7; +#endif +using BH.Engine.Serialiser; +using BH.Engine.Adapter; +using BH.oM.Adapters.GSA; +using BH.oM.Structure.Elements; +using BH.oM.Structure.Constraints; +using System.Collections.Generic; +using BH.oM.Adapters.GSA.Elements; +using System; +using System.Linq; + +namespace BH.Adapter.GSA +{ + public static partial class Convert + { + /***************************************************/ + /**** Public Methods ****/ + /***************************************************/ + + public static List FromGsaRigidConstraint(IEnumerable gsaStrings, Dictionary nodes) + { + List constraintList = new List(); + + foreach (string gsaString in gsaStrings) + { + string[] tokens = gsaString.Split(','); + + int primaryNodeName = int.Parse(tokens[2]); + string linkTypeString = tokens[3]; + string[] constrainedNodeNames = tokens[4].Split(','); + + Node primaryNode; + nodes.TryGetValue(primaryNodeName, out primaryNode); + + List constrainedNodes = new List(); + + foreach (string constrainedNodeName in constrainedNodeNames) + { + if (int.TryParse(constrainedNodeName, out int constrainedNodeId)) + { + if (nodes.TryGetValue(constrainedNodeId, out Node constrainedNode)) + constrainedNodes.Add(constrainedNode); + } + } + + RigidConstraintLinkType linkType = RigidConstraintLinkType.ALL; + + if (Enum.TryParse(linkTypeString, out RigidConstraintLinkType parsedLinkType)) + linkType = parsedLinkType; + + RigidConstraint constraint = new RigidConstraint() + { + PrimaryNode = primaryNode, + ConstrainedNodes = constrainedNodes, + Type = linkType + }; + + constraintList.Add(constraint); + } + + return constraintList; + } + + + + + + /***************************************************/ + + } +} + + + + diff --git a/GSA_Adapter/Convert/FromGsa/Elements/RigidLink.cs b/GSA_Adapter/Convert/FromGsa/Elements/RigidLink.cs index 473afd01..8a6feaf1 100644 --- a/GSA_Adapter/Convert/FromGsa/Elements/RigidLink.cs +++ b/GSA_Adapter/Convert/FromGsa/Elements/RigidLink.cs @@ -31,7 +31,7 @@ using BH.oM.Structure.Elements; using BH.oM.Structure.Constraints; using System.Collections.Generic; - +using System.Linq; namespace BH.Adapter.GSA { @@ -41,10 +41,12 @@ public static partial class Convert /**** Public Methods ****/ /***************************************************/ - public static List FromGsaRigidLinks(IEnumerable gsaElements, Dictionary constraints, Dictionary nodes) + public static List FromGsaRigidLinks(IEnumerable gsaElements, IEnumerable gsaStrings, Dictionary constraints, Dictionary nodes) { + List linkList = new List(); + //Rigid Link foreach (GsaElement gsaLink in gsaElements) { if (gsaLink.eType != 9) @@ -61,8 +63,150 @@ public static List FromGsaRigidLinks(IEnumerable gsaEleme int id = gsaLink.Ref; link.SetAdapterId(typeof(GSAId), id); linkList.Add(link); + } + + //Rigid Constraint + foreach (string gsaString in gsaStrings) + { + string[] tokens = gsaString.Split(','); + + string linkName = tokens[1]; + int primaryNodeName = int.Parse(tokens[2]); + string linkTypeString = tokens[3]; + string[] constrainedNodeNames = tokens[4].Split(' '); + + Node primaryNode; + nodes.TryGetValue(primaryNodeName, out primaryNode); + + List constrainedNodes = new List(); + + foreach (string constrainedNodeName in constrainedNodeNames) + { + if (int.TryParse(constrainedNodeName, out int constrainedNodeId)) + { + if (nodes.TryGetValue(constrainedNodeId, out Node constrainedNode)) + constrainedNodes.Add(constrainedNode); + } + } + + LinkConstraint linkType; + + switch (linkTypeString) + { + case "ALL": + linkType = Engine.Structure.Create.LinkConstraintFixed(); + break; + case "PIN": + linkType = Engine.Structure.Create.LinkConstraintPinned(); + break; + case "XY_PLANE": + linkType = Engine.Structure.Create.LinkConstraintXYPlane(); + break; + case "ZX_PLANE": + linkType = Engine.Structure.Create.LinkConstraintZXPlane(); + break; + case "YZ_PLANE": + linkType = Engine.Structure.Create.LinkConstraintYZPlane(); + break; + case "XY_PLANE_PIN": + linkType = Engine.Structure.Create.LinkConstraintXYPlanePin(); + break; + case "ZX_PLANE_PIN": + linkType = Engine.Structure.Create.LinkConstraintZXPlanePin(); + break; + case "YZ_PLANE_PIN": + linkType = Engine.Structure.Create.LinkConstraintYZPlanePin(); + break; + case "XY_PLATE": + linkType = Engine.Structure.Create.LinkConstraintYPlateZPlate(); //Wrong name in engine. Should be just ZPlate. + break; + case "ZX_PLATE": + linkType = Engine.Structure.Create.LinkConstraintYPlate(); + break; + case "YZ_PLATE": + linkType = Engine.Structure.Create.LinkConstraintXPlate(); + break; + case "XY_PLATE_PIN": + linkType = Engine.Structure.Create.LinkConstraintZPlatePin(); + break; + case "ZX_PLATE_PIN": + linkType = Engine.Structure.Create.LinkConstraintYPlatePin(); + break; + case "YZ_PLATE_PIN": + linkType = Engine.Structure.Create.LinkConstraintXPlatePin(); + break; + default: + //String in format example: X:XYY-Y:YZZXX-Z:YY-XX:XX-YY:YY-ZZ:ZZ + linkType = new LinkConstraint(); + string[] constraintProps = linkTypeString.Split('-'); + foreach (string c in constraintProps) + { + string[] fromTo = c.Split(':'); + string from = fromTo[0]; + string to = fromTo[1]; + switch (from) + { + case "X": + if (to.Contains('X')) + linkType.XtoX = true; + if (to.Contains('Y')) + linkType.XtoYY = true; + if (to.Contains('Z')) + linkType.XtoZZ = true; + break; + case "Y": + if (to.Contains('X')) + linkType.YtoXX = true; + if (to.Contains('Y')) + linkType.YtoY = true; + if (to.Contains('Z')) + linkType.YtoZZ = true; + break; + case "Z": + if (to.Contains('X')) + linkType.ZtoXX = true; + if (to.Contains('Y')) + linkType.ZtoYY = true; + if (to.Contains('Z')) + linkType.ZtoZ = true; + break; + case "XX": + if (to.Contains("XX")) + linkType.XXtoXX = true; + break; + case "YY": + if (to.Contains("YY")) + linkType.YYtoYY = true; + break; + case "ZZ": + if (to.Contains("ZZ")) + linkType.ZZtoZZ = true; + break; + } + } + break; + } + + RigidLink link = new RigidLink() + { + PrimaryNode = primaryNode, + SecondaryNodes = constrainedNodes, + Constraint = linkType + }; + + link.ApplyTaggedName(linkName); + + IsRigidConstraint RCtag = new IsRigidConstraint + { + RigidConstraint = true + }; + + link.Fragments.Add(RCtag); + + linkList.Add(link); } + return linkList; } diff --git a/GSA_Adapter/Convert/FromGsa/Properties/LinkConstraint.cs b/GSA_Adapter/Convert/FromGsa/Properties/LinkConstraint.cs index b0fa03fa..70d4bd28 100644 --- a/GSA_Adapter/Convert/FromGsa/Properties/LinkConstraint.cs +++ b/GSA_Adapter/Convert/FromGsa/Properties/LinkConstraint.cs @@ -68,24 +68,24 @@ public static LinkConstraint FromGsaLinkConstraint(string gsaProp) case "YZ_PLANE_PIN": constraint = Engine.Structure.Create.LinkConstraintYZPlanePin(); break; - //case "XY_PLATE": - // constraint = BHP.LinkConstraint.ZPlate; - // break; - //case "ZX_PLATE": - // constraint = BHP.LinkConstraint.YPlate; - // break; - //case "YZ_PLATE": - // constraint = BHP.LinkConstraint.YPlate; - // break; //TODO: CHECK CONSTRUCTOR NAMES IN BHOM_ENGINE - //case "XY_PLATE_PIN": - // constraint = BHP.LinkConstraint.ZPlatePin; - // break; - //case "ZX_PLATE_PIN": - // constraint = BHP.LinkConstraint.YPlatePin; - // break; - //case "YZ_PLATE_PIN": - // constraint = BHP.LinkConstraint.ZPlatePin; - // break; + case "XY_PLATE": + constraint = Engine.Structure.Create.LinkConstraintYPlateZPlate(); //TODO: Wrong name in engine. Should be just ZPlate. + break; + case "ZX_PLATE": + constraint = Engine.Structure.Create.LinkConstraintYPlate(); + break; + case "YZ_PLATE": + constraint = Engine.Structure.Create.LinkConstraintXPlate(); + break; + case "XY_PLATE_PIN": + constraint = Engine.Structure.Create.LinkConstraintZPlatePin(); + break; + case "ZX_PLATE_PIN": + constraint = Engine.Structure.Create.LinkConstraintYPlatePin(); + break; + case "YZ_PLATE_PIN": + constraint = Engine.Structure.Create.LinkConstraintXPlatePin(); + break; default: //String in format example: X:XYY-Y:YZZXX-Z:YY-XX:XX-YY:YY-ZZ:ZZ constraint = new LinkConstraint(); diff --git a/GSA_Adapter/Convert/FromGsa/Properties/Material.cs b/GSA_Adapter/Convert/FromGsa/Properties/Material.cs index 6a8a180b..a60a892e 100644 --- a/GSA_Adapter/Convert/FromGsa/Properties/Material.cs +++ b/GSA_Adapter/Convert/FromGsa/Properties/Material.cs @@ -203,13 +203,13 @@ private static void OrthotropicMaterialProperties(string gsaString, out double e v2 = double.Parse(gStr[10]); v3 = double.Parse(gStr[11]); - g1 = double.Parse(gStr[16]); - g2 = double.Parse(gStr[17]); - g3 = double.Parse(gStr[18]); + g1 = double.Parse(gStr[13]); + g2 = double.Parse(gStr[14]); + g3 = double.Parse(gStr[15]); - tC1 = double.Parse(gStr[13]); - tC2 = double.Parse(gStr[14]); - tC3 = double.Parse(gStr[15]); + tC1 = double.Parse(gStr[16]); + tC2 = double.Parse(gStr[17]); + tC3 = double.Parse(gStr[18]); rho = double.Parse(gStr[12]); diff --git a/GSA_Adapter/Convert/FromGsa/Properties/SectionProperty.cs b/GSA_Adapter/Convert/FromGsa/Properties/SectionProperty.cs index 24606c50..35f02b76 100644 --- a/GSA_Adapter/Convert/FromGsa/Properties/SectionProperty.cs +++ b/GSA_Adapter/Convert/FromGsa/Properties/SectionProperty.cs @@ -124,6 +124,7 @@ public static ISectionProperty FromGsaSectionProperty(string gsaString, Dictiona else { secName = secName.TrimEnd((".0").ToCharArray()); + if (desc[1].Contains("CHS")) { description = "STD" + splitChar + secType + splitChar; diff --git a/GSA_Adapter/Convert/ToGsa/Elements/RigidConstraint.cs b/GSA_Adapter/Convert/ToGsa/Elements/RigidConstraint.cs new file mode 100644 index 00000000..80c61f56 --- /dev/null +++ b/GSA_Adapter/Convert/ToGsa/Elements/RigidConstraint.cs @@ -0,0 +1,71 @@ +/* + * This file is part of the Buildings and Habitats object Model (BHoM) + * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * + * Each contributor holds copyright over their respective contributions. + * The project versioning (Git) records all such contribution source information. + * + * + * The BHoM is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3.0 of the License, or + * (at your option) any later version. + * + * The BHoM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this code. If not, see . + */ + +using BH.Engine.Serialiser; +using BH.Engine.Adapter; +using System.Collections.Generic; +using BH.oM.Adapters.GSA; +using BH.oM.Structure.Elements; +using BH.Engine.Adapters.GSA; +using BH.oM.Adapters.GSA.Elements; + +namespace BH.Adapter.GSA +{ + public static partial class Convert + { + /***************************************************/ + /**** Public Methods ****/ + /***************************************************/ + + public static string ToGsaString(this RigidConstraint rigidConstraint) + { + string command = "RIGID.2"; + string name = rigidConstraint.TaggedName().ToGSACleanName(); + + string primaryNode = rigidConstraint.PrimaryNode.GSAId().ToString(); + + List constrainedNodes = rigidConstraint.ConstrainedNodes; + string constrainedNodesIds = ""; + + foreach (Node constrainedNode in constrainedNodes) + { + string id = constrainedNode.GSAId().ToString(); + constrainedNodesIds = constrainedNodesIds + " " + id; + } + + string type = rigidConstraint.Type.ToString(); + + + //RIGID.2 | name | primary_node | type | constrained_nodes | stage + string str = command + ", " + name + ", " + primaryNode + " , " + type + ", " + constrainedNodesIds; + return str; + } + + + /***************************************************/ + + } +} + + + + diff --git a/GSA_Adapter/Convert/ToGsa/Elements/RigidLink.cs b/GSA_Adapter/Convert/ToGsa/Elements/RigidLink.cs index c9bc1a2f..8ff41dd4 100644 --- a/GSA_Adapter/Convert/ToGsa/Elements/RigidLink.cs +++ b/GSA_Adapter/Convert/ToGsa/Elements/RigidLink.cs @@ -25,6 +25,9 @@ using BH.oM.Adapters.GSA; using BH.oM.Structure.Elements; using BH.Engine.Adapters.GSA; +using BH.oM.Base; +using BH.Engine.Base; +using System.Collections.Generic; namespace BH.Adapter.GSA { @@ -36,27 +39,110 @@ public static partial class Convert public static string ToGsaString(this RigidLink link, string index, int secondaryIndex = 0) { - string command = "EL.2"; - string name = link.TaggedName().ToGSACleanName(); - string type = "LINK"; + if (CheckRigCon(link) == false) + { + string command = "EL.2"; + string name = link.TaggedName().ToGSACleanName(); + string type = "LINK"; - string constraintIndex = link.Constraint.GSAId().ToString(); - string group = "0"; + string constraintIndex = link.Constraint.GSAId().ToString(); + string group = "0"; - string startIndex = link.PrimaryNode.GSAId().ToString(); + string startIndex = link.PrimaryNode.GSAId().ToString(); - string endIndex = link.SecondaryNodes[secondaryIndex].GSAId().ToString(); + string endIndex = link.SecondaryNodes[secondaryIndex].GSAId().ToString(); - string dummy = CheckDummy(link); + string dummy = CheckDummy(link); - //EL 1 gfdgfdg NO_RGB LINK 1 1 1 2 0 0 NO_RLS NO_OFFSET DUMMY - string str = command + ", " + index + "," + name + ", NO_RGB , " + type + " , " + constraintIndex + ", " + group + ", " + startIndex + ", " + endIndex + " , 0" + ",0" + ", NO_RLS" + ", NO_OFFSET," + dummy; - return str; + //EL 1 gfdgfdg NO_RGB LINK 1 1 1 2 0 0 NO_RLS NO_OFFSET DUMMY + string str = command + ", " + index + "," + name + ", NO_RGB , " + type + " , " + constraintIndex + ", " + group + ", " + startIndex + ", " + endIndex + " , 0" + ",0" + ", NO_RLS" + ", NO_OFFSET," + dummy; + return str; + } + else { + string command = "RIGID.2"; + string name = link.TaggedName().ToGSACleanName(); + + string primaryNode = link.PrimaryNode.GSAId().ToString(); + + List constrainedNodes = link.SecondaryNodes; + string constrainedNodesIds = ""; + + foreach (Node constrainedNode in constrainedNodes) + { + string id = constrainedNode.GSAId().ToString(); + constrainedNodesIds = constrainedNodesIds + " " + id; + } + + string typename = link.Name.ToString(); + string type; + + switch (typename) + { + case "Fixed": + type = "ALL"; + break; + case "xy-Plane": + type = "XY_PLANE"; + break; + case "yz-Plane": + type = "YZ_PLANE"; + break; + case "zx-Plane": + type = "ZX_PLANE"; + break; + case "z-Plate": + type = "XY_PLATE"; + break; + case "x-Plate": + type = "YZ_PLATE"; + break; + case "y-Plate": + type = "ZX_PLATE"; + break; + case "Pinned": + type = "PIN"; + break; + case "xy-Plane Pin": + type = "XY_PLANE_PIN"; + break; + case "yz-Plane Pin": + type = "YZ_PLANE_PIN"; + break; + case "zx-Plane Pin": + type = "ZX_PLANE_PIN"; + break; + case "z-Plate Pin": + type = "XY_PLATE_PIN"; + break; + case "x-Plate Pin": + type = "YZ_PLATE_PIN"; + break; + case "y-Plate Pin": + type = "ZX_PLATE_PIN"; + break; + default: + type = "All"; + break; + } + + //RIGID.2 | name | primary_node | type | constrained_nodes | stage + string str = command + ", " + name + ", " + primaryNode + " , " + type + ", " + constrainedNodesIds; + return str; + } } /***************************************************/ + public static bool CheckRigCon(BHoMObject obj) + { + IsRigidConstraint tag = obj.FindFragment(); + + if (tag != null && tag.RigidConstraint) + return true; + + return false; + } } } diff --git a/GSA_Adapter/Properties/AssemblyInfo.cs b/GSA_Adapter/Properties/AssemblyInfo.cs index 03f2d73e..9a0d316a 100644 --- a/GSA_Adapter/Properties/AssemblyInfo.cs +++ b/GSA_Adapter/Properties/AssemblyInfo.cs @@ -53,8 +53,8 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.0.0.0")] -[assembly: AssemblyFileVersion("6.3.0.0")] +[assembly: AssemblyVersion("7.0.0.0")] +[assembly: AssemblyFileVersion("7.0.0.0")] diff --git a/GSA_Engine/Properties/AssemblyInfo.cs b/GSA_Engine/Properties/AssemblyInfo.cs index 417fe7f4..f04ac9a6 100644 --- a/GSA_Engine/Properties/AssemblyInfo.cs +++ b/GSA_Engine/Properties/AssemblyInfo.cs @@ -53,8 +53,8 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.0.0.0")] -[assembly: AssemblyFileVersion("6.3.0.0")] +[assembly: AssemblyVersion("7.0.0.0")] +[assembly: AssemblyFileVersion("7.0.0.0")] diff --git a/GSA_oM/Elements/RigidConstraint.cs b/GSA_oM/Elements/RigidConstraint.cs new file mode 100644 index 00000000..f59ec63b --- /dev/null +++ b/GSA_oM/Elements/RigidConstraint.cs @@ -0,0 +1,54 @@ +/* + * This file is part of the Buildings and Habitats object Model (BHoM) + * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * + * Each contributor holds copyright over their respective contributions. + * The project versioning (Git) records all such contribution source information. + * + * + * The BHoM is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3.0 of the License, or + * (at your option) any later version. + * + * The BHoM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this code. If not, see . + */ + +using BH.oM.Base; +using System; +using System.ComponentModel; +using System.Collections.Generic; +using BH.oM.Quantities.Attributes; +using BH.oM.Structure.Elements; +using BH.oM.Adapters.GSA.SpacerProperties; +using BH.oM.Analytical.Elements; + +namespace BH.oM.Adapters.GSA.Elements +{ + [Description("A rigid constraint defining linkage between nodes.")] + public class RigidConstraint : BHoMObject + { + /***************************************************/ + /**** Properties ****/ + /***************************************************/ + + [Description("Defines the primary node of the rigid constraint.")] + public virtual Node PrimaryNode { get; set; } + + [Description("Defines the constrained nodes of the rigid constraint. Can be a list of nodes.")] + public virtual List ConstrainedNodes { get; set; } + + [Description("Type of rigid constraint.")] + public virtual RigidConstraintLinkType Type { get; set; } = RigidConstraintLinkType.ALL; + + + } +} + + diff --git a/GSA_oM/Enum/RigidConstraintLinkType.cs b/GSA_oM/Enum/RigidConstraintLinkType.cs new file mode 100644 index 00000000..1bfde4ef --- /dev/null +++ b/GSA_oM/Enum/RigidConstraintLinkType.cs @@ -0,0 +1,47 @@ +/* + * This file is part of the Buildings and Habitats object Model (BHoM) + * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * + * Each contributor holds copyright over their respective contributions. + * The project versioning (Git) records all such contribution source information. + * + * + * The BHoM is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3.0 of the License, or + * (at your option) any later version. + * + * The BHoM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this code. If not, see . + */ + +using System.ComponentModel; + +namespace BH.oM.Adapters.GSA +{ + [Description("Defines type rigid constraint link.")] + public enum RigidConstraintLinkType + { + ALL, + XY_PLANE, + YZ_PLANE, + ZX_PLANE, + XY_PLATE, + YZ_PLATE, + ZX_PLATE, + PIN, + XY_PLANE_PIN, + YZ_PLANE_PIN, + ZX_PLANE_PIN, + XY_PLATE_PIN, + YZ_PLATE_PIN, + ZX_PLATE_PIN + } +} + + diff --git a/GSA_oM/Fragments/IsRigidConstraint.cs b/GSA_oM/Fragments/IsRigidConstraint.cs new file mode 100644 index 00000000..9b04af88 --- /dev/null +++ b/GSA_oM/Fragments/IsRigidConstraint.cs @@ -0,0 +1,37 @@ +/* + * This file is part of the Buildings and Habitats object Model (BHoM) + * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * + * Each contributor holds copyright over their respective contributions. + * The project versioning (Git) records all such contribution source information. + * + * + * The BHoM is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3.0 of the License, or + * (at your option) any later version. + * + * The BHoM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this code. If not, see . + */ + + +using BH.oM.Base; +using System.ComponentModel; + +namespace BH.oM.Adapters.GSA +{ + [Description("A fragment to identify whether the RigidLink is a Constraint or Link (i.e. element) in GSA.")] + public class IsRigidConstraint : IFragment + { + [Description("True means the RigidLink will be treated as a Rigid Constraint in GSA, false means it will be treated as a Link.")] + public virtual bool RigidConstraint { get; set; } = false; + } +} + + diff --git a/GSA_oM/GSA_oM.csproj b/GSA_oM/GSA_oM.csproj index 9d45eecf..83bd4ecc 100644 --- a/GSA_oM/GSA_oM.csproj +++ b/GSA_oM/GSA_oM.csproj @@ -89,6 +89,7 @@ + diff --git a/GSA_oM/Properties/AssemblyInfo.cs b/GSA_oM/Properties/AssemblyInfo.cs index 79948642..376091f5 100644 --- a/GSA_oM/Properties/AssemblyInfo.cs +++ b/GSA_oM/Properties/AssemblyInfo.cs @@ -54,8 +54,8 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.0.0.0")] -[assembly: AssemblyFileVersion("6.3.0.0")] +[assembly: AssemblyVersion("7.0.0.0")] +[assembly: AssemblyFileVersion("7.0.0.0")] diff --git a/README.md b/README.md index 4514274a..51537451 100644 --- a/README.md +++ b/README.md @@ -26,12 +26,12 @@ Grab the [latest installer](https://bhom.xyz/) and a selection of [sample script ## Getting Started for Developers 🤖 If you want to build the BHoM and the Toolkits from source, it's hopefully easy! 😄 -Do take a look at our specific wiki pages here: [Getting Started for Developers](https://github.com/BHoM/documentation/wiki/Getting-started-for-developers) +Do take a look at our specific wiki pages here: [Getting Started for Developers](https://bhom.xyz/documentation/Contributing/Getting-started-for-developers/) ## Want to Contribute? ## -BHoM is an open-source project and would be nothing without its community. Take a look at our contributing guidelines and tips [here](https://github.com/BHoM/BHoM/blob/master/CONTRIBUTING.md). +BHoM is an open-source project and would be nothing without its community. Take a look at our contributing guidelines and tips [here](https://github.com/BHoM/BHoM/blob/main/CONTRIBUTING.md). ## Licence ## @@ -39,5 +39,5 @@ BHoM is an open-source project and would be nothing without its community. Take BHoM is free software licenced under GNU Lesser General Public Licence - [https://www.gnu.org/licenses/lgpl-3.0.html](https://www.gnu.org/licenses/lgpl-3.0.html) Each contributor holds copyright over their respective contributions. The project versioning (Git) records all such contribution source information. -See [LICENSE](https://github.com/BHoM/BHoM/blob/master/LICENSE) and [COPYRIGHT_HEADER](https://github.com/BHoM/BHoM/blob/master/COPYRIGHT_HEADER.txt). +See [LICENSE](https://github.com/BHoM/BHoM/blob/main/LICENSE) and [COPYRIGHT_HEADER](https://github.com/BHoM/BHoM/blob/main/COPYRIGHT_HEADER.txt).