/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static Constraint4DOF ToConstraint4DOF(this IFSupportStructural lusasAttribute) { List <string> releaseNames = new List <string> { "U", "V", "W", "THX" }; List <DOFType> fixity = new List <DOFType>(); List <double> stiffness = new List <double>(); foreach (string releaseName in releaseNames) { string fixityValue = lusasAttribute.getValue(releaseName); if (fixityValue == "F") { fixity.Add(DOFType.Free); stiffness.Add(0.0); } else if (fixityValue == "R") { fixity.Add(DOFType.Fixed); stiffness.Add(0.0); } else if (fixityValue == "S") { fixity.Add(DOFType.Spring); double stiffnessValue = lusasAttribute.getValue(releaseName + "stiff"); stiffness.Add(stiffnessValue); } } string attributeName = GetName(lusasAttribute); Constraint4DOF constraint4DOF = new Constraint4DOF { Name = attributeName }; constraint4DOF.TranslationX = fixity[0]; constraint4DOF.TranslationY = fixity[1]; constraint4DOF.TranslationZ = fixity[2]; constraint4DOF.RotationX = fixity[3]; constraint4DOF.RotationalStiffnessX = stiffness[0]; constraint4DOF.TranslationalStiffnessX = stiffness[1]; constraint4DOF.TranslationalStiffnessX = stiffness[2]; constraint4DOF.TranslationalStiffnessX = stiffness[3]; int adapterNameId = lusasAttribute.getID(); constraint4DOF.SetAdapterId(typeof(LusasId), adapterNameId); return(constraint4DOF); }
/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static Constraint6DOF ToConstraint6DOF(this IFSupportStructural lusasAttribute) { List <string> releaseNames = new List <string> { "U", "V", "W", "THX", "THY", "THZ" }; List <bool> fixity = new List <bool>(); List <double> stiffness = new List <double>(); foreach (string releaseName in releaseNames) { string fixityValue = lusasAttribute.getValue(releaseName); if (fixityValue == "F") { fixity.Add(false); stiffness.Add(0.0); } else if (fixityValue == "R") { fixity.Add(true); stiffness.Add(0.0); } else if (fixityValue == "S") { fixity.Add(false); double stiffnessValue = lusasAttribute.getValue(releaseName + "stiff"); stiffness.Add(stiffnessValue); } } string attributeName = GetName(lusasAttribute); Constraint6DOF constraint6DOF = BH.Engine.Structure.Create.Constraint6DOF( attributeName, fixity, stiffness); int adapterNameId = lusasAttribute.getID(); constraint6DOF.SetAdapterId(typeof(LusasId), adapterNameId); return(constraint6DOF); }