Exemplo n.º 1
0
        //Sets all the member loads to RFEM (Only uniform distributed load is implemented
        private static void setRFEMmemberLoads(ILoads rLoads, MemberLoad[] rMemberLoads)
        {
            Dictionary <int, List <MemberLoad> > loads = new Dictionary <int, List <MemberLoad> >();

            foreach (MemberLoad rMemberLoad in rMemberLoads)
            {
                if (!loads.ContainsKey(int.Parse(rMemberLoad.Comment)))
                {
                    List <MemberLoad> nLoad = new List <MemberLoad>();
                    MemberLoad        a     = rMemberLoad;
                    a.Comment = "";
                    nLoad.Add(a);

                    loads[int.Parse(rMemberLoad.Comment)] = nLoad;
                }
                else
                {
                    MemberLoad a = rMemberLoad;
                    a.Comment = "";
                    loads[int.Parse(rMemberLoad.Comment)].Add(a);
                }
            }
            foreach (int n in loads.Keys)
            {
                ILoadCase lCase = rLoads.GetLoadCase(n, ItemAt.AtNo);
                lCase.PrepareModification();

                lCase.SetMemberLoads(loads[n].ToArray());
                lCase.FinishModification();
            }
        }
Exemplo n.º 2
0
        //this method creates uniform member load
        private static void createUniformLoad(Karamba.Loads.ElementLoad kElementLoad, ref Dictionary <Vector3d, MemberLoad> forceList)
        {
            Karamba.Loads.UniformlyDistLoad load = kElementLoad as Karamba.Loads.UniformlyDistLoad;
            if (!forceList.ContainsKey(load.Load))
            {
                MemberLoad rMemberLoad = new MemberLoad();
                if (load.Load.X != 0)
                {
                    rMemberLoad.Direction  = LoadDirectionType.GlobalXType;
                    rMemberLoad.Magnitude1 = load.Load.X * 1000;
                }
                else if (load.Load.Y != 0)
                {
                    rMemberLoad.Direction  = LoadDirectionType.GlobalYType;
                    rMemberLoad.Magnitude1 = load.Load.Y * 1000;
                }
                else
                {
                    rMemberLoad.Direction  = LoadDirectionType.GlobalZType;
                    rMemberLoad.Magnitude1 = load.Load.Z * 1000;
                }

                rMemberLoad.Type         = LoadType.ForceType;
                rMemberLoad.Distribution = LoadDistributionType.UniformType;
                int ind;


                if (!string.IsNullOrEmpty(kElementLoad.beamId) && int.TryParse(kElementLoad.beamId.Substring(1), out ind))
                {
                    rMemberLoad.ObjectList = kElementLoad.beamId.Substring(1);
                }
                else
                {
                    MessageBox.Show("Karamba beam naming was incorrect. Has to be of form E001 where E is identifier letter" +
                                    "and 001 is number of the beam in the RFEM", "Error", MessageBoxButtons.OK);
                }

                rMemberLoad.No = forceList.Count + 1;
                rMemberLoad.OverTotalLength = true;
                forceList[load.Load]        = rMemberLoad;
            }
            else
            {
                MemberLoad temp = forceList[load.Load];

                int ind;
                if (!string.IsNullOrEmpty(kElementLoad.beamId) && int.TryParse(kElementLoad.beamId.Substring(1), out ind))
                {
                    temp.ObjectList += "," + kElementLoad.beamId.Substring(1);
                }
                else
                {
                    MessageBox.Show("Karamba beam naming was incorrect. Has to be of form E001 where E is identifier letter" +
                                    "and 001 is number of the beam in the RFEM", "Error", MessageBoxButtons.OK);
                }
                forceList[load.Load] = temp;
            }
        }
 public RFMemberLoad(MemberLoad load, int loadcase)
 {
     MemberList   = load.ObjectList;
     Comment      = load.Comment;
     ID           = load.ID;
     IsValid      = load.IsValid;
     No           = load.No;
     Tag          = load.Tag;
     LoadDirType  = load.Direction;
     LoadDistType = load.Distribution;
     LoadRefType  = load.ReferenceTo;
     LoadType     = load.Type;
     DistanceA    = load.DistanceA;
     DistanceB    = load.DistanceB;
     if (load.RelativeDistances)
     {
         DistanceA /= 100;
         DistanceB /= 100;
     }
     if (LoadType == LoadType.ForceType || LoadType == LoadType.MomentType)
     {
         Magnitude1 = load.Magnitude1 / 1000;
         Magnitude2 = load.Magnitude2;
         if (load.Distribution != LoadDistributionType.ConcentratedNxQType && load.Distribution != LoadDistributionType.Concentrated2x2QType)
         {
             Magnitude2 /= 1000;
         }
         Magnitude3 = load.Magnitude3 / 1000;
     }
     else
     {
         Magnitude1 = load.Magnitude1;
         Magnitude2 = load.Magnitude2;
         Magnitude3 = load.Magnitude3;
         Magnitude4 = load.Magnitude4;
         Magnitude5 = load.Magnitude5;
         Magnitude6 = load.Magnitude6;
     }
     LoadArray         = load.LoadArray;
     OverTotalLength   = load.OverTotalLength;
     RelativeDistances = load.RelativeDistances;
     LoadCase          = loadcase;
     ToModify          = false;
     ToDelete          = false;
 }