Exemplo n.º 1
0
        /***************************************************/

        public static List <ICurve> Visualize(this BarPointLoad barPointForce, double scaleFactor = 1.0, bool displayForces = true, bool displayMoments = true, bool asResultants = true)
        {
            List <ICurve> arrows = new List <ICurve>();

            Vector forceVec  = barPointForce.Force * scaleFactor;
            Vector momentVec = barPointForce.Moment * scaleFactor;

            foreach (Bar bar in barPointForce.Objects.Elements)
            {
                Cartesian system;
                Vector[]  loads = BarForceVectors(bar, forceVec, momentVec, barPointForce.Axis, barPointForce.Projected, out system);
                Point     point = bar.StartNode.Position();
                Vector    tan   = bar.Tangent(true);
                point += tan * barPointForce.DistanceFromA;

                if (displayForces)
                {
                    arrows.AddRange(Arrows(point, loads[0], true, asResultants, system));
                }
                if (displayMoments)
                {
                    arrows.AddRange(Arrows(point, loads[1], false, asResultants, system));
                }
            }

            return(arrows);
        }
Exemplo n.º 2
0
        /***************************************************/

        private bool CreateLoad(BarPointLoad bhLoad)
        {
            List <Bar> bars     = bhLoad.Objects.Elements.ToList();
            string     loadPat  = GetAdapterId <string>(bhLoad.Loadcase);
            int        loadType = 0;

            int[]    dirs       = null;
            double[] forceVals  = null;
            double[] momentVals = null;
            double   dist       = bhLoad.DistanceFromA;
            bool     relDist    = false; // BarPointLoad is defined as absolute distance from i (A) end of bar.

            // Determine coordinate system (local vs global) and set directions vector for CSI protocol
            switch (bhLoad.Axis)
            {
            case LoadAxis.Global:
                dirs       = new int[] { 4, 5, 6 };
                forceVals  = bhLoad.Force.ToDoubleArray();
                momentVals = bhLoad.Moment.ToDoubleArray();
                break;

            case LoadAxis.Local:
                dirs       = new int[] { 1, 2, 3 };
                forceVals  = bhLoad.Force.BarLocalAxisToCSI().ToDoubleArray();
                momentVals = bhLoad.Moment.BarLocalAxisToCSI().ToDoubleArray();
                break;
            }

            // Loop through bars and set point loads
            string    cSys    = bhLoad.Axis.ToCSI();
            bool      replace = SAPPushConfig.ReplaceLoads;
            eItemType type    = eItemType.Objects;

            foreach (Bar bar in bars)
            {
                string barName    = GetAdapterId <string>(bar);
                bool   replaceNow = replace;

                for (int i = 0; i < dirs.Count(); i++)
                {
                    loadType = 1; // handle forces first
                    if (m_model.FrameObj.SetLoadPoint(barName, loadPat, loadType, dirs[i], dist, forceVals[i], cSys, relDist, replaceNow, type) != 0)
                    {
                        CreateElementError("BarPointLoad-Force", bar.Name + dirs[i]);
                    }
                    replaceNow = false;
                    loadType   = 2; // handle moments second
                    if (m_model.FrameObj.SetLoadPoint(barName, loadPat, loadType, dirs[i], dist, momentVals[i], cSys, relDist, replaceNow, type) != 0)
                    {
                        CreateElementError("BarPointLoad-Moment", bar.Name + dirs[i]);
                    }
                }
            }

            SetAdapterId(bhLoad, null);

            return(true);
        }
Exemplo n.º 3
0
        /***************************************************/

        public void SetLoad(BarPointLoad barPointLoad, bool replace)
        {
            string axis;
            int    shift;

            GetDirectionData(barPointLoad, out axis, out shift);
            foreach (Bar bar in barPointLoad.Objects.Elements)
            {
                bool stepReplace = replace;

                string caseName = GetAdapterId <string>(barPointLoad.Loadcase);
                string barName  = GetAdapterId <string>(bar);

                for (int direction = 1; direction <= 3; direction++)
                {
                    int    ret = 1;
                    double val = direction == 1 ? barPointLoad.Force.X : barPointLoad.Axis == LoadAxis.Global ?
                                 direction == 2 ? barPointLoad.Force.Y : barPointLoad.Force.Z :
                                 direction == 2 ? barPointLoad.Force.Z : -barPointLoad.Force.Y; //note: etabs acts different then stated in API documentstion

                    if (val != 0)
                    {
                        ret         = m_model.FrameObj.SetLoadPoint(barName, caseName, 1, direction + shift, barPointLoad.DistanceFromA, val, axis, false, stepReplace);
                        stepReplace = false;
                    }
                }
                // Moment
                for (int direction = 1; direction <= 3; direction++)
                {
                    int    ret = 1;
                    double val = direction == 1 ? barPointLoad.Moment.X : barPointLoad.Axis == LoadAxis.Global ?
                                 direction == 2 ? barPointLoad.Moment.Y : barPointLoad.Moment.Z :
                                 direction == 2 ? barPointLoad.Moment.Z : -barPointLoad.Moment.Y; //note: etabs acts different then stated in API documentstion

                    if (val != 0)
                    {
                        ret         = m_model.FrameObj.SetLoadPoint(barName, caseName, 2, direction + shift, barPointLoad.DistanceFromA, val, axis, false, stepReplace);
                        stepReplace = false;
                    }
                }
            }
        }
Exemplo n.º 4
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private List <ILoad> ReadBarPointLoads(List <string> ids = null)
        {
            List <ILoad> barPointLoads = new List <ILoad>();

            object[] lusasInternalBeamPointLoads = d_LusasData.getAttributes("Beam Point Load");

            if (lusasInternalBeamPointLoads.Count() != 0)
            {
                List <Bar> barsList           = ReadBars();
                Dictionary <string, Bar> bars = barsList.ToDictionary(
                    x => x.AdapterId <string>(typeof(LusasId)));

                List <IFLoadcase> allLoadcases = new List <IFLoadcase>();

                for (int i = 0; i < lusasInternalBeamPointLoads.Count(); i++)
                {
                    IFLoading lusasInternalBeamPointLoad = (IFLoading)lusasInternalBeamPointLoads[i];
                    IEnumerable <IGrouping <string, IFAssignment> > groupedByLoadcases =
                        GetLoadAssignments(lusasInternalBeamPointLoad);

                    foreach (IEnumerable <IFAssignment> groupedAssignment in groupedByLoadcases)
                    {
                        BarPointLoad barPointLoad =
                            Adapters.Lusas.Convert.ToBarPointLoad(
                                lusasInternalBeamPointLoad, groupedAssignment, bars);

                        List <string> analysisName = new List <string> {
                            lusasInternalBeamPointLoad.getAttributeType()
                        };
                        barPointLoad.Tags = new HashSet <string>(analysisName);
                        barPointLoads.Add(barPointLoad);
                    }
                }
            }

            return(barPointLoads);
        }
Exemplo n.º 5
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private IFLoadingBeamPoint CreateBarPointLoad(BarPointLoad barPointLoad, object[] lusasLines)
        {
            IFLoadingBeamPoint lusasBarPointLoad;
            IFLoadcase         assignedLoadcase = (IFLoadcase)d_LusasData.getLoadset(barPointLoad.Loadcase.AdapterId <int>(typeof(LusasId)));

            if (d_LusasData.existsAttribute("Loading", barPointLoad.Name))
            {
                lusasBarPointLoad = (IFLoadingBeamPoint)d_LusasData.getAttribute("Loading", barPointLoad.Name);
            }
            else
            {
                lusasBarPointLoad = d_LusasData.createLoadingBeamPoint(barPointLoad.Name);
                if (barPointLoad.Axis.ToString() == "Global")
                {
                    lusasBarPointLoad.setBeamPoint("parametric", "global", "beam");
                }
                else
                {
                    lusasBarPointLoad.setBeamPoint("parametric", "local", "beam");
                }
                lusasBarPointLoad.addRow(
                    barPointLoad.DistanceFromA,
                    barPointLoad.Force.X, barPointLoad.Force.Y, barPointLoad.Force.Z,
                    barPointLoad.Moment.X, barPointLoad.Moment.Y, barPointLoad.Moment.Z);
            }

            IFAssignment lusasAssignment = m_LusasApplication.assignment();

            lusasAssignment.setLoadset(assignedLoadcase);
            lusasBarPointLoad.assignTo(lusasLines, lusasAssignment);

            int adapterIdName = lusasBarPointLoad.getID();

            barPointLoad.SetAdapterId(typeof(LusasId), adapterIdName);

            return(lusasBarPointLoad);
        }
Exemplo n.º 6
0
 public static LoadType LoadType(this BarPointLoad load)
 {
     return(oM.Structure.Loads.LoadType.BarPointLoad);
 }
Exemplo n.º 7
0
        /***************************************************/

        private List <ILoad> ReadBarPointLoad(List <Loadcase> loadcases)
        {
            List <ILoad> bhLoads = new List <ILoad>();

            Dictionary <string, Bar> bhomBars = ReadBar().ToDictionary(x => GetAdapterId <string>(x));

            string[] names     = null;
            string[] loadcase  = null;
            string[] CSys      = null;
            int[]    myType    = null;
            int[]    dir       = null;
            int      nameCount = 0;

            double[] relDist = null;
            double[] dist    = null;
            double[] value   = null;

            if (m_model.FrameObj.GetLoadPoint("All", ref nameCount, ref names, ref loadcase, ref myType, ref CSys, ref dir, ref relDist, ref dist, ref value, eItemType.Group) != 0)
            {
                return(bhLoads);
            }

            for (int i = 0; i < nameCount; i++)
            {
                Loadcase bhLoadcase = loadcases.FirstOrDefault(x => x.Name == loadcase[i]);

                if (bhLoadcase == null)
                {
                    continue;
                }

                Vector force = Direction(dir[i], value[i]);

                BHoMGroup <Bar> barObjects = new BHoMGroup <Bar>()
                {
                    Elements = { bhomBars[names[i]] }
                };

                BarPointLoad bhBarPointLoad = new BarPointLoad()
                {
                    DistanceFromA = dist[i],
                    Loadcase      = bhLoadcase,
                    Objects       = barObjects
                };

                switch (myType[i])
                {
                case 1:
                    bhBarPointLoad.Force = force;
                    break;

                case 2:
                    bhBarPointLoad.Moment = force;
                    break;

                default:
                    BH.Engine.Base.Compute.RecordWarning("Could not create the load. It's not 'MyType'. MyType = " + myType[i].ToString());
                    continue;
                }

                SetDirection(bhBarPointLoad, dir[i], CSys[i]);

                bhLoads.Add(bhBarPointLoad);
            }

            return(bhLoads);
        }
Exemplo n.º 8
0
        /***************************************************/
        /**** Private methods                           ****/
        /***************************************************/

        private List <ILoad> ReadLoads(List <string> ids = null)
        {
            List <ILoad> loadList = new List <ILoad>();


            if (ids == null)
            {
                List <rf.LoadCase> rfLoadcases = model.GetLoads().GetLoadCases().ToList();
                rf.ILoads          l           = model.GetLoads();
                int lcCount = l.GetLoadCaseCount();

                Dictionary <int, Loadcase> bhLoadcaseDict = new Dictionary <int, Loadcase>();
                bhLoadcaseDict = ReadLoadcases().Distinct().ToDictionary(x => x.Number, x => x);

                Dictionary <string, Bar> bhBarDict = new Dictionary <string, Bar>();
                bool barsRead = false;

                for (int i = 0; i < lcCount; i++)
                {
                    rf.LoadCase rfLoadcase = l.GetLoadCase(i, rf.ItemAt.AtIndex).GetData();
                    Loadcase    bhLoadcase;

                    bhLoadcase = bhLoadcaseDict[rfLoadcase.Loading.No];


                    rf.MemberLoad[] rfMemberLoads = l.GetLoadCase(i, rf.ItemAt.AtIndex).GetMemberLoads();
                    if (rfMemberLoads.Length > 0)
                    {
                        if (!barsRead)
                        {
                            bhBarDict = ReadBars().ToDictionary(x => GetAdapterId(x).ToString(), x => x);
                            barsRead  = true;
                        }


                        foreach (rf.MemberLoad rfLoad in rfMemberLoads)
                        {
                            List <string>           barIds   = BH.Engine.Adapters.RFEM.Compute.GetIdListFromString(rfLoad.ObjectList);
                            oM.Base.BHoMGroup <Bar> barGroup = new oM.Base.BHoMGroup <Bar>();
                            barGroup.Elements.AddRange(barIds.Where(k => bhBarDict.ContainsKey(k)).Select(k => bhBarDict[k]));


                            if (rfLoad.Distribution == rf.LoadDistributionType.UniformType)
                            {
                                BarUniformlyDistributedLoad barUniformLoad = rfLoad.FromRFEM(bhLoadcase, barGroup);
                                loadList.Add(barUniformLoad);
                            }
                            else if (rfLoad.Distribution == rf.LoadDistributionType.ConcentratedType)
                            {
                                BarPointLoad barPointLoad = new BarPointLoad();
                                //...
                            }
                            else
                            {
                                Engine.Base.Compute.RecordWarning("Load distribution of type: " + rfLoad.Distribution.ToString() + " is not supported!");
                            }
                        }
                    }
                }
            }
            else
            {
                foreach (string id in ids)
                {
                    //loadList.Add();
                }
            }

            return(loadList);
        }
Exemplo n.º 9
0
        private List <ILoad> ReadBarPointLoad(List <Loadcase> loadcases)
        {
            int err = 0;
            Dictionary <int, Loadcase> lcDict = loadcases.ToDictionary(x => GetAdapterId <int>(x));
            List <ILoad> bhLoads = new List <ILoad>();
            List <Bar>   allBars = ReadBars();

            foreach (Bar bar in allBars)
            {
                double length = BH.Engine.Geometry.Query.Length(BH.Engine.Structure.Query.Centreline(bar));
                int    barId  = GetAdapterId <int>(bar);

                // ***************** try to get point forces first ************************
                // ****************************** global **********************************
                int globalPointForceCount = 0;
                err = St7.St7GetEntityAttributeSequenceCount(1, St7.tyBEAM, barId, St7.aoBeamCFG, ref globalPointForceCount);
                if (globalPointForceCount > 0)
                {
                    // getting load IDs
                    int[] sequenceNumbers = new int[globalPointForceCount * 4];
                    err = St7.St7GetEntityAttributeSequence(1, St7.tyBEAM, barId, St7.aoBeamCFG, globalPointForceCount, sequenceNumbers);
                    for (int i = 0; i < globalPointForceCount; i++)
                    {
                        int      loadCaseNum = sequenceNumbers[4 * i + St7.ipAttrCase];
                        int      loadID      = sequenceNumbers[4 * i + St7.ipAttrID];
                        double[] forcesG     = new double[4];
                        err = St7.St7GetBeamPointForceGlobal4ID(1, barId, loadCaseNum, loadID, forcesG);
                        if (!IsZeroSqLength(forcesG))
                        {
                            BarPointLoad bhLoad = new BarPointLoad()
                            {
                                DistanceFromA = length * forcesG[3],
                                Force         = new Vector()
                                {
                                    X = forcesG[0], Y = forcesG[1], Z = forcesG[2]
                                },
                                Loadcase  = lcDict[loadCaseNum],
                                Projected = false,
                                Axis      = LoadAxis.Global,
                                Objects   = new BHoMGroup <Bar>()
                                {
                                    Elements = { bar }
                                }
                            };
                            bhLoads.Add(bhLoad);
                        }
                    }
                }
                int globalPointMomentCount = 0;
                err = St7.St7GetEntityAttributeSequenceCount(1, St7.tyBEAM, barId, St7.aoBeamCMG, ref globalPointMomentCount);
                if (globalPointMomentCount > 0)
                {
                    // getting load IDs
                    int[] sequenceNumbers = new int[globalPointMomentCount * 4];
                    err = St7.St7GetEntityAttributeSequence(1, St7.tyBEAM, barId, St7.aoBeamCMG, globalPointMomentCount, sequenceNumbers);
                    for (int i = 0; i < globalPointMomentCount; i++)
                    {
                        int      loadCaseNum = sequenceNumbers[4 * i + St7.ipAttrCase];
                        int      loadID      = sequenceNumbers[4 * i + St7.ipAttrID];
                        double[] momentsG    = new double[4];
                        err = St7.St7GetBeamPointMomentGlobal4ID(1, barId, loadCaseNum, loadID, momentsG);
                        if (!IsZeroSqLength(momentsG))
                        {
                            BarPointLoad bhLoad = new BarPointLoad()
                            {
                                DistanceFromA = length * momentsG[3],
                                Moment        = new Vector()
                                {
                                    X = momentsG[0], Y = momentsG[1], Z = momentsG[2]
                                },
                                Loadcase  = lcDict[loadCaseNum],
                                Projected = false,
                                Axis      = LoadAxis.Global,
                                Objects   = new BHoMGroup <Bar>()
                                {
                                    Elements = { bar }
                                }
                            };
                            bhLoads.Add(bhLoad);
                        }
                    }
                }
                // ****************************** principal **********************************
                int principalPointForceCount = 0;
                err = St7.St7GetEntityAttributeSequenceCount(1, St7.tyBEAM, barId, St7.aoBeamCFL, ref principalPointForceCount);
                if (principalPointForceCount > 0)
                {
                    // getting load IDs
                    int[] sequenceNumbers = new int[principalPointForceCount * 4];
                    err = St7.St7GetEntityAttributeSequence(1, St7.tyBEAM, barId, St7.aoBeamCFL, principalPointForceCount, sequenceNumbers);
                    for (int i = 0; i < principalPointForceCount; i++)
                    {
                        int      loadCaseNum = sequenceNumbers[4 * i + St7.ipAttrCase];
                        int      loadID      = sequenceNumbers[4 * i + St7.ipAttrID];
                        double[] forcesP     = new double[4];
                        err = St7.St7GetBeamPointForcePrincipal4ID(1, barId, loadCaseNum, loadID, forcesP);
                        if (!IsZeroSqLength(forcesP))
                        {
                            BarPointLoad bhLoad = new BarPointLoad()
                            {
                                DistanceFromA = length * forcesP[3],
                                //Force = BH.Engine.Geometry.Modify.Transform(new Vector() { X = forcesP[0], Y = forcesP[1], Z = forcesP[2] }, transformMatrix),
                                Force = new Vector()
                                {
                                    X = forcesP[0], Y = forcesP[1], Z = forcesP[2]
                                },
                                Loadcase  = lcDict[loadCaseNum],
                                Projected = false,
                                Axis      = LoadAxis.Local,
                                Objects   = new BHoMGroup <Bar>()
                                {
                                    Elements = { bar }
                                }
                            };
                            bhLoads.Add(bhLoad);
                        }
                    }
                }
                int principalPointMomentCount = 0;
                err = St7.St7GetEntityAttributeSequenceCount(1, St7.tyBEAM, barId, St7.aoBeamCML, ref principalPointMomentCount);
                if (principalPointMomentCount > 0)
                {
                    // getting load IDs
                    int[] sequenceNumbers = new int[principalPointMomentCount * 4];
                    err = St7.St7GetEntityAttributeSequence(1, St7.tyBEAM, barId, St7.aoBeamCML, principalPointMomentCount, sequenceNumbers);
                    for (int i = 0; i < principalPointMomentCount; i++)
                    {
                        int      loadCaseNum = sequenceNumbers[4 * i + St7.ipAttrCase];
                        int      loadID      = sequenceNumbers[4 * i + St7.ipAttrID];
                        double[] momentsP    = new double[4];
                        err = St7.St7GetBeamPointMomentPrincipal4ID(1, barId, loadCaseNum, loadID, momentsP);
                        if (!IsZeroSqLength(momentsP))
                        {
                            BarPointLoad bhLoad = new BarPointLoad()
                            {
                                DistanceFromA = length * momentsP[3],
                                //Moment = BH.Engine.Geometry.Modify.Transform(new Vector() { X = momentsP[0], Y = momentsP[1], Z = momentsP[2] }, transformMatrix),
                                Moment = new Vector()
                                {
                                    X = momentsP[0], Y = momentsP[1], Z = momentsP[2]
                                },
                                Projected = false,
                                Axis      = LoadAxis.Local,
                                Loadcase  = lcDict[loadCaseNum],
                                Objects   = new BHoMGroup <Bar>()
                                {
                                    Elements = { bar }
                                }
                            };
                            bhLoads.Add(bhLoad);
                        }
                    }
                }
            }
            return(bhLoads);
        }
Exemplo n.º 10
0
        /***************************************************/
        /**** Private methods                           ****/
        /***************************************************/

        private bool CreateObject(BarPointLoad barPointLoad)
        {
            int err        = 0;
            int uID        = 1;
            int loadCaseId = GetAdapterId <int>(barPointLoad.Loadcase);

            // *************************** GLOBAL ***************************
            if (barPointLoad.Axis == LoadAxis.Global)
            {
                foreach (Bar bar in barPointLoad.Objects.Elements)
                {
                    double length = BH.Engine.Geometry.Query.Length(BH.Engine.Structure.Query.Centreline(bar));
                    int    barId  = GetAdapterId <int>(bar);
                    // creating global Point Forces
                    if (BH.Engine.Geometry.Query.Length(barPointLoad.Force) > 0)
                    {
                        // get number of global point forces at the beam
                        int globalPointForceCount = 0;
                        err = St7.St7GetEntityAttributeSequenceCount(uID, St7.tyBEAM, barId, St7.aoBeamCFG, ref globalPointForceCount);
                        if (!St7ErrorCustom(err, "Couldn't get a number of global point beam loads for a loadcase " + loadCaseId + " beam " + barId))
                        {
                            return(false);
                        }
                        double[] forces = new double[4];
                        forces[0] = barPointLoad.Force.X;
                        forces[1] = barPointLoad.Force.Y;
                        forces[2] = barPointLoad.Force.Z;
                        forces[3] = barPointLoad.DistanceFromA / length;
                        err       = St7.St7SetBeamPointForceGlobal4ID(uID, barId, loadCaseId, globalPointForceCount + 1, forces);
                        if (!St7ErrorCustom(err, "Couldn't set global point beam loads for a loadcase " + loadCaseId + " beam " + barId))
                        {
                            return(false);
                        }
                    }
                    // creating global Point Moments
                    if (BH.Engine.Geometry.Query.Length(barPointLoad.Moment) > 0)
                    {
                        // get number of global point moments at the beam
                        int globalPointMomentCount = 0;
                        err = St7.St7GetEntityAttributeSequenceCount(uID, St7.tyBEAM, barId, St7.aoBeamCMG, ref globalPointMomentCount);
                        if (!St7ErrorCustom(err, "Couldn't get a number of global point beam moments for a loadcase " + loadCaseId + " beam " + barId))
                        {
                            return(false);
                        }
                        double[] moments = new double[4];
                        moments[0] = barPointLoad.Moment.X;
                        moments[1] = barPointLoad.Moment.Y;
                        moments[2] = barPointLoad.Moment.Z;
                        moments[3] = barPointLoad.DistanceFromA / length;
                        err        = St7.St7SetBeamPointMomentGlobal4ID(uID, barId, loadCaseId, globalPointMomentCount + 1, moments);
                        if (!St7ErrorCustom(err, "Couldn't set global point beam moments for a loadcase " + loadCaseId + " beam " + barId))
                        {
                            return(false);
                        }
                    }
                }
            }
            // *************************** LOCAL ****************************
            if (barPointLoad.Axis == LoadAxis.Local)
            {
                foreach (Bar bar in barPointLoad.Objects.Elements)
                {
                    double length = BH.Engine.Geometry.Query.Length(BH.Engine.Structure.Query.Centreline(bar));
                    int    barId  = GetAdapterId <int>(bar);

                    if (BH.Engine.Geometry.Query.Length(barPointLoad.Force) > 0)
                    {
                        // get number of local point forces at the beam
                        int localPointForceCount = 0;
                        err = St7.St7GetEntityAttributeSequenceCount(uID, St7.tyBEAM, barId, St7.aoBeamCFL, ref localPointForceCount);
                        if (!St7ErrorCustom(err, "Couldn't get a number of local point beam loads for a loadcase " + loadCaseId + " beam " + barId))
                        {
                            return(false);
                        }
                        double[] forces = new double[4];
                        forces[0] = barPointLoad.Force.X;
                        forces[1] = barPointLoad.Force.Y;
                        forces[2] = barPointLoad.Force.Z;
                        forces[3] = barPointLoad.DistanceFromA / length;
                        err       = St7.St7SetBeamPointForcePrincipal4ID(uID, barId, loadCaseId, localPointForceCount + 1, forces);
                        if (!St7ErrorCustom(err, "Couldn't set local point beam loads for a loadcase " + loadCaseId + " beam " + barId))
                        {
                            return(false);
                        }
                    }
                    // creating global Point Moments
                    if (BH.Engine.Geometry.Query.Length(barPointLoad.Moment) > 0)
                    {
                        // get number of local point moments at the beam
                        int localPointMomentCount = 0;
                        err = St7.St7GetEntityAttributeSequenceCount(uID, St7.tyBEAM, barId, St7.aoBeamCML, ref localPointMomentCount);
                        if (!St7ErrorCustom(err, "Couldn't get a number of local point beam moments for a loadcase " + loadCaseId + " beam " + barId))
                        {
                            return(false);
                        }
                        double[] moments = new double[4];
                        moments[0] = barPointLoad.Moment.X;
                        moments[1] = barPointLoad.Moment.Y;
                        moments[2] = barPointLoad.Moment.Z;
                        moments[3] = barPointLoad.DistanceFromA / length;
                        err        = St7.St7SetBeamPointMomentPrincipal4ID(uID, barId, loadCaseId, localPointMomentCount + 1, moments);
                        if (!St7ErrorCustom(err, "Couldn't set local point beam moments for a loadcase " + loadCaseId + " beam " + barId))
                        {
                            return(false);
                        }
                    }
                }
            }
            return(true);
        }