Exemple #1
0
        private List <ILoad> ReadGravityLoad(List <Loadcase> loadcases)
        {
            int          err     = 0;
            List <ILoad> bhLoads = new List <ILoad>();

            foreach (Loadcase ldcs in loadcases)
            {
                if (ldcs.Nature == LoadNature.Dead)
                {
                    int    dir = 0;
                    double x = 0, y = 0, z = 0;
                    err = St7.St7GetLoadCaseGravityDir(1, GetAdapterId <int>(ldcs), ref dir);
                    if (!St7ErrorCustom(err, "Could not get a direction for gravity lc #" + GetAdapterId <int>(ldcs)))
                    {
                        return(bhLoads);
                    }
                    if (dir == 1)
                    {
                        x = -1;
                    }
                    if (dir == 2)
                    {
                        y = -1;
                    }
                    if (dir == 3)
                    {
                        z = -1;
                    }
                    Vector vector = BH.Engine.Geometry.Create.Vector(x, y, z);
                    bhLoads.Add(BH.Engine.Structure.Create.GravityLoad(ldcs, vector, new BHoMObject[] { }));
                }
            }
            return(bhLoads);
        }