Exemple #1
0
        /***************************************************/

        private List <RAMFactoredEndReactions> ReadBeamEndReactions(List <string> ids = null)
        {
            List <RAMFactoredEndReactions> barEndReactions = new List <RAMFactoredEndReactions>();

            IModel ramModel = m_Application.GetDispInterfacePointerByEnum(EINTERFACES.IModel_INT);

            List <IBeam> ramBeams = ReadRamBeams(ramModel);

            foreach (IBeam beam in ramBeams)
            {
                IAnalyticalResult result = beam.GetAnalyticalResult();
                IMemberForces     forces = result.GetMaximumComboReactions(COMBO_MATERIAL_TYPE.GRAV_STEEL);

                RAMFactoredEndReactions bhomEndReactions = new RAMFactoredEndReactions()
                {
                    ObjectId      = beam.lUID,
                    StartReaction = forces.GetAt(0).ToBHoMObject(),
                    EndReaction   = forces.GetAt(1).ToBHoMObject(),
                };

                barEndReactions.Add(bhomEndReactions);
            }

            return(barEndReactions);
        }
Exemple #2
0
        /***************************************************/

        public static Node ToBHoMObject(this INode ramNode)
        {
            // Get the location of the node
            SCoordinate location = new SCoordinate();

            location = ramNode.sLocation;

            Node node = new Node {
                Position = location.PointFromRAM()
            };

            IMemberForces IMemberForces = ramNode.GetReactions();

            // Collect all member forces at node, tracked by index; should these be combined?
            for (int i = 0; i < IMemberForces.GetCount(); i++)
            {
                RAMNodeForceData ramNodeForceData = new RAMNodeForceData();

                IMemberForce IMemberForce = IMemberForces.GetAt(i);
                double       axial        = IMemberForce.dAxial;
                double       loc          = IMemberForce.dLocation;
                double       momMaj       = IMemberForce.dMomentMajor;
                double       momMin       = IMemberForce.dMomentMinor;
                double       shearMaj     = IMemberForce.dShearMajor;
                double       shearMin     = IMemberForce.dShearMinor;
                double       torsion      = IMemberForce.dTorsion;
                string       loadcaseID   = IMemberForce.lLoadCaseID.ToString();

                //Set by member number--is there a way to do this in nested lists instead?
                ramNodeForceData.Axial      = axial;
                ramNodeForceData.Location   = loc;
                ramNodeForceData.MomMaj     = momMaj;
                ramNodeForceData.MomMin     = momMin;
                ramNodeForceData.ShearMaj   = shearMaj;
                ramNodeForceData.ShearMin   = shearMin;
                ramNodeForceData.Torsion    = torsion;
                ramNodeForceData.LoadcaseID = loadcaseID;

                node.Fragments.Add(ramNodeForceData);
            }

            return(node);
        }