Ejemplo n.º 1
0
        public void AddToList(string str, int SpanNo)
        {
            str = str.Replace('\t', ' ');

            while (str.Contains("  "))
            {
                str = str.Replace("  ", " ");
            }
            MyStrings mList = new MyStrings(str, ' ');

            /*
             *
             * SPAN NO. 1
             * SECTION NO. DISTANCE(m)                    SHEAR                         MOMENT
             * 1         0.00                       131.10                           0.00
             * 2         0.60                       100.50                          69.48
             * 3         1.20                        69.90                         120.60
             *
             *
             */

            try
            {
                BeamAnalysis beamAna = new BeamAnalysis();
                beamAna.SpanNo    = SpanNo;
                beamAna.SectionNo = mList.GetInt(0);
                beamAna.Distance  = mList.GetDouble(1);
                beamAna.Shear     = mList.GetDouble(2);
                beamAna.Moment    = mList.GetDouble(3);
                Add(beamAna);
            }
            catch (Exception exx)
            {
            }
        }
Ejemplo n.º 2
0
        public void SetConstants(string s)
        {
            //CONSTANTS
            //E 3150 ALL
            //DEN 0.000383 ALL

            //3 CONSTANTS
            //E 200 1 TO 47
            //DEN 0.078 1 TO 47
            int indx = -1;

            string temp = s.Replace('\t', ' ').Trim().TrimEnd().TrimStart().ToUpper();

            while (temp.Contains("  "))
            {
                temp = temp.Replace("  ", " ");
            }
            MyStrings mList = new MyStrings(temp, ' ');


            if (list.Count == 0)
            {
                MemberProperty mp = null;
                for (int i = 0; i < AnalysisData.Members.Count; i++)
                {
                    mp = new MemberProperty();
                    mp.Member.MemberNo = AnalysisData.Members[i].MemberNo;
                    list.Add(mp);
                }
            }


            if (mList.StringList[0] == "E")
            {
                if (mList.StringList.Contains("ALL"))
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        list[i].E = mList.StringList[1];
                    }
                }
                else if (mList.StringList.Contains("TO"))
                {
                    indx = mList.StringList.IndexOf("TO");
                    //for (int i = mList.GetInt(indx - 1); i <= mList.GetInt(indx + 1); i++)
                    //{
                    //    list[i].E = mList.GetDouble(1);
                    //}
                    for (int i = mList.GetInt(indx - 1); i <= mList.GetInt(indx + 1); i++)
                    {
                        this[IndexOf(i)].E = mList.StringList[1];
                    }
                }
                else
                {
                    mList.StringList.RemoveAt(0);
                    //mList.StringList.RemoveAt(0);

                    double val = mList.GetDouble(0);
                    for (int i = 1; i < mList.Count; i++)
                    {
                        this[IndexOf(mList.GetInt(i))].E = mList.StringList[0];
                    }
                }
            }
            if (mList.StringList[0].StartsWith("DEN"))
            {
                if (mList.StringList.Contains("ALL"))
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        list[i].DEN = mList.StringList[1];
                    }
                }
                else if (mList.StringList.Contains("TO"))
                {
                    indx = mList.StringList.IndexOf("TO");
                    //for (int i = mList.GetInt(indx - 1); i <= mList.GetInt(indx + 1); i++)
                    //{
                    //    list[i].DEN = mList.StringList[1];
                    //}
                    for (int i = mList.GetInt(indx - 1); i <= mList.GetInt(indx + 1); i++)
                    {
                        this[IndexOf(i)].DEN = mList.StringList[1];
                        //list[i].PR = mList.StringList[1];
                    }
                }
                else
                {
                    mList.StringList.RemoveAt(0);
                    //mList.StringList.RemoveAt(0);

                    //double val = mList.GetDouble(0);
                    for (int i = 1; i < mList.Count; i++)
                    {
                        this[IndexOf(mList.GetInt(i))].DEN = mList.StringList[0];
                    }
                }
            }
            if (mList.StringList[0] == "PR" || mList.StringList[0] == "POISSON")
            {
                if (mList.StringList.Contains("ALL"))
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        list[i].PR = mList.StringList[1];
                    }
                }
                else if (mList.StringList.Contains("TO"))
                {
                    indx = mList.StringList.IndexOf("TO");
                    for (int i = mList.GetInt(indx - 1); i <= mList.GetInt(indx + 1); i++)
                    {
                        this[IndexOf(i)].PR = mList.StringList[1];
                        //list[i].PR = mList.StringList[1];
                    }
                }
                else
                {
                    mList.StringList.RemoveAt(0);
                    for (int i = 1; i < mList.Count; i++)
                    {
                        this[IndexOf(mList.GetInt(i))].PR = mList.StringList[0];
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public void AddTxt_2014_04_07(string s)
        {
            //1 2 PRISMATIC YD 12 ZD 12 IZ 509 IY 509 IX 1018
            //3 TO 10 PR YD 12 ZD 12 IZ 864 IY 864 IX 1279
            //11 TO 21 PR YD 21 ZD 16 IZ 5788 IY 2953 IX 6497


            //1 TO 993 AX 0.54 IX 0.07390   IY 0.00911   IZ 0.06480

            //1 3 4 A 28.11 IX 1509.4 IY 188.6 ; 2 A 21.67 IX 839.1 IY 94.8
            //5 6 7 A 43.24 IX 3920.5 IY 448.6 ; 8 TO 13 A 36.71 IX 2624.5 IY 328.8
            //14 TO 23 A 3.07 IX 4.5

            //1 2 3 13 14 15 16 18 94 95 100 TO 105 116 TO 129 165 167 172 173 174 184 TO 186 AX 0.54 IX 0.07390   IY 0.00911   IZ 0.06480



            string temp = s.ToUpper().Trim().TrimEnd().TrimStart().Replace("PRISMATIC", "PR");

            List <string> lstStr = new List <string>(temp.Split(new char[] { ' ' }));
            MyStrings     mList  = new MyStrings(lstStr);

            double area, yd, zd, ix, iy, iz;
            int    indx = -1;

            List <int> mems = MyStrings.Get_Array_Intiger(temp);

            area = yd = zd = ix = iy = iz = 0.0d;
            int toIndex = lstStr.IndexOf("TO");

            if (lstStr.Contains("YD"))
            {
                indx = lstStr.IndexOf("YD");
                yd   = mList.GetDouble(indx + 1);
            }
            if (lstStr.Contains("ZD"))
            {
                indx = lstStr.IndexOf("ZD");
                zd   = mList.GetDouble(indx + 1);
            }
            if (lstStr.Contains("IX"))
            {
                indx = lstStr.IndexOf("IX");
                ix   = mList.GetDouble(indx + 1);
            }
            if (lstStr.Contains("IY"))
            {
                indx = lstStr.IndexOf("IY");
                iy   = mList.GetDouble(indx + 1);
            }

            if (lstStr.Contains("IZ"))
            {
                indx = lstStr.IndexOf("IZ");
                iz   = mList.GetDouble(indx + 1);
            }
            if (lstStr.Contains("AX"))
            {
                indx = lstStr.IndexOf("AX");
                area = mList.GetDouble(indx + 1);
            }
            if (lstStr.Contains("A"))
            {
                indx = lstStr.IndexOf("A");
                area = mList.GetDouble(indx + 1);
            }

            try
            {
                //1 2 3 13 14 15 16 18 94 95 100 TO 105 116 TO 129 165 167 172 173 174 184 TO 186 AX 0.54 IX 0.07390   IY 0.00911   IZ 0.06480
                if (lstStr.Contains("TO"))
                {
                    MyStrings tempLst = new MyStrings(temp, ' ');
                    toIndex = tempLst.StringList.IndexOf("TO", 0);
                    while (tempLst.StringList.Contains("TO"))
                    {
                        toIndex = tempLst.StringList.IndexOf("TO", 0);
                        if (toIndex > 1)
                        {
                            for (int i = 0; i < (toIndex - 1); i++)
                            {
                                MemberProperty mp = new MemberProperty();
                                mp.Member.MemberNo = tempLst.GetInt(i);
                                mp.YD   = yd;
                                mp.ZD   = zd;
                                mp.IX   = ix;
                                mp.IY   = iy;
                                mp.IZ   = iz;
                                mp.Area = area;
                                Add(mp);
                            }
                            tempLst.StringList.RemoveRange(0, toIndex - 1);
                        }
                        toIndex = tempLst.StringList.IndexOf("TO", 0);
                        for (int i = tempLst.GetInt(toIndex - 1); i <= tempLst.GetInt(toIndex + 1); i++)
                        {
                            MemberProperty mp = new MemberProperty();
                            mp.Member.MemberNo = i;
                            mp.YD   = yd;
                            mp.ZD   = zd;
                            mp.IX   = ix;
                            mp.IY   = iy;
                            mp.IZ   = iz;
                            mp.Area = area;
                            Add(mp);
                        }
                        tempLst.StringList.RemoveRange(0, toIndex + 2);
                    }
                    return;
                }
            }
            catch (Exception exx)
            {
            }



            //if (lstStr.Contains("TO"))
            //{
            //    toIndex = lstStr.IndexOf("TO");
            //    for (int i = mList.GetInt(toIndex - 1); i <= mList.GetInt(toIndex + 1); i++)
            //    {
            //        MemberProperty mp = new MemberProperty();
            //        mp.Member.MemberNo = i;
            //        mp.YD = yd;
            //        mp.ZD = zd;
            //        mp.IX = ix;
            //        mp.IY = iy;
            //        mp.IZ = iz;
            //        mp.Area = area;
            //        Add(mp);
            //    }
            //}
            //else
            //{
            //indx = lstStr.IndexOf("PR");
            if (indx == -1)
            {
                indx = lstStr.IndexOf("A");
                if (indx == -1)
                {
                    indx = lstStr.IndexOf("AX");
                }
            }
            for (int i = 0; i < indx; i++)
            {
                MemberProperty mp = new MemberProperty();
                mp.Member.MemberNo = mList.GetInt(i);
                mp.YD   = yd;
                mp.ZD   = zd;
                mp.IX   = ix;
                mp.IY   = iy;
                mp.IZ   = iz;
                mp.Area = area;
                Add(mp);
            }
            //}
        }
Ejemplo n.º 4
0
        public void AddTxt(string s)
        {
            //1 2 PRISMATIC YD 12 ZD 12 IZ 509 IY 509 IX 1018
            //3 TO 10 PR YD 12 ZD 12 IZ 864 IY 864 IX 1279
            //11 TO 21 PR YD 21 ZD 16 IZ 5788 IY 2953 IX 6497


            //1 TO 993 AX 0.54 IX 0.07390   IY 0.00911   IZ 0.06480

            //1 3 4 A 28.11 IX 1509.4 IY 188.6 ; 2 A 21.67 IX 839.1 IY 94.8
            //5 6 7 A 43.24 IX 3920.5 IY 448.6 ; 8 TO 13 A 36.71 IX 2624.5 IY 328.8
            //14 TO 23 A 3.07 IX 4.5

            //1 2 3 13 14 15 16 18 94 95 100 TO 105 116 TO 129 165 167 172 173 174 184 TO 186 AX 0.54 IX 0.07390   IY 0.00911   IZ 0.06480



            string temp = s.ToUpper().Trim().TrimEnd().TrimStart().Replace("PRISMATIC", "PR");

            List <string> lstStr = new List <string>(temp.Split(new char[] { ' ' }));
            MyStrings     mList  = new MyStrings(lstStr);

            double area, yd, zd, ix, iy, iz;
            int    indx = -1;

            List <int> mems = MyStrings.Get_Array_Intiger(temp);

            if (AnalysisData != null)
            {
                if (mems.Count == 0)
                {
                    foreach (var item in AnalysisData.MemberGroups.GroupCollection)
                    {
                        if (item.GroupName == mList.StringList[0])
                        {
                            mems = MyStrings.Get_Array_Intiger(item.MemberNosText); break;
                        }
                    }
                }
            }


            area = yd = zd = ix = iy = iz = 0.0d;
            int toIndex = lstStr.IndexOf("TO");

            if (lstStr.Contains("YD"))
            {
                indx = lstStr.IndexOf("YD");
                yd   = mList.GetDouble(indx + 1);
            }
            if (lstStr.Contains("ZD"))
            {
                indx = lstStr.IndexOf("ZD");
                zd   = mList.GetDouble(indx + 1);
            }
            if (lstStr.Contains("IX"))
            {
                indx = lstStr.IndexOf("IX");
                ix   = mList.GetDouble(indx + 1);
            }
            if (lstStr.Contains("IY"))
            {
                indx = lstStr.IndexOf("IY");
                iy   = mList.GetDouble(indx + 1);
            }

            if (lstStr.Contains("IZ"))
            {
                indx = lstStr.IndexOf("IZ");
                iz   = mList.GetDouble(indx + 1);
            }
            if (lstStr.Contains("AX"))
            {
                indx = lstStr.IndexOf("AX");
                area = mList.GetDouble(indx + 1);
            }
            if (lstStr.Contains("A"))
            {
                indx = lstStr.IndexOf("A");
                area = mList.GetDouble(indx + 1);
            }

            try
            {
                //1 2 3 13 14 15 16 18 94 95 100 TO 105 116 TO 129 165 167 172 173 174 184 TO 186 AX 0.54 IX 0.07390   IY 0.00911   IZ 0.06480

                MemberProperty mp = null;
                for (int i = 0; i < mems.Count; i++)
                {
                    mp = new MemberProperty();
                    mp.Member.MemberNo = mems[i];
                    mp.YD   = yd;
                    mp.ZD   = zd;
                    mp.IX   = ix;
                    mp.IY   = iy;
                    mp.IZ   = iz;
                    mp.Area = area;
                    Add(mp);
                }
            }
            catch (Exception exww) { }
        }
Ejemplo n.º 5
0
        public void AddAST(string s)
        {
            //
            //N003 UNIT 1.000 0.083 KIP FT KIP INCH member#, section_ID#,B, D, Do, Di, area*lfact*lfact, ix*lfact*lfact*lfact*lfact, iy*lfact*lfact*lfact*lfact, iy*lfact*lfact*lfact*lfact
            //N003	1	1	0	0	0	0	144	1018	509	509
            //N003	2	1	0	0	0	0	144	1018	509	509



            //N003 element#,section_ID#,B     , D,       Do,     Di,     area     , ix,         iy,          iz
            // 0       1     2          3       4        5       6         7         8           9           10
            //N003     1     1     0.000000 0.000000 0.000000 0.000000 144.000000 1018.000000 509.000000 509.000000
            //N003     2     1     0.000000 0.000000 0.000000 0.000000 144.000000 1018.000000 509.000000 509.000000


            //N004  element#,mat_ID#, emod     , pr,   mden,   wden   ,  alpha,   beta
            //0        1     2     3             4      5         6        7        8
            //N004     1     1   3150.000      0.150 0.000383 0.000383 0.000012 0.000000
            //N004     2     1   3150.000      0.150 0.000383 0.000383 0.000012 0.000000
            //N004     3     1   3150.000      0.150 0.000383 0.000383 0.000012 0.000000
            //N004     4     1   3150.000      0.150 0.000383 0.000383 0.000012 0.000000
            string temp = s.Trim().TrimEnd().TrimStart().Replace('\t', ' ');

            while (temp.Contains("  "))
            {
                temp = temp.Replace("  ", " ");
            }

            MemberProperty mProp = new MemberProperty();
            MyStrings      mList = new MyStrings(temp, ' ');

            if (mList.StringList[0] == "N003")
            {
                mProp.Member.MemberNo = mList.GetInt(1);

                mProp.YD = mList.GetDouble(3);
                mProp.ZD = mList.GetDouble(4);

                mProp.Area = mList.GetDouble(7);
                mProp.IX   = mList.GetDouble(8);
                mProp.IY   = mList.GetDouble(9);
                mProp.IZ   = mList.GetDouble(10);

                Add(mProp);
            }
            else if (mList.StringList[0] == "N004")
            {
                int indx = IndexOf(mList.GetInt(1));
                if (indx != -1)
                {
                    list[indx].E   = mList.StringList[3];
                    list[indx].PR  = mList.StringList[4];
                    list[indx].DEN = mList.StringList[5];
                }
                else
                {
                    //mProp = new MemberProperty();
                    //mProp.Member.MemberNo = mList.GetInt(1);
                    //mProp.Area = mList.GetDouble(7);
                    //mProp.IX = mList.GetDouble(8);
                    //mProp.IY = mList.GetDouble(9);
                    //mProp.IZ = mList.GetDouble(10);
                }
            }
        }
Ejemplo n.º 6
0
        public bool Read_Type_From_Text_File(string fileName)
        {
            // Text File
            // Example 7
            //LOAD GENERATION 191
            //TYPE 1 -18.8 0 2.75 XINC 0.2
            //TYPE 1 -18.8 0 6.25 XINC 0.2
            //TYPE 1 -18.8 0 9.75 XINC 0.2

            // AST File
            //LOAD GENERATION 191
            //N012 TYPE 1 -18.8 0 2.75 XINC 0.2
            //N012 TYPE 1 -18.8 0 6.25 XINC 0.2
            //N012 TYPE 1 -18.8 0 9.75 XINC 0.2


            if (!File.Exists(fileName))
            {
                return(false);
            }


            bool IsAst = false;

            if (Path.GetExtension(fileName).ToLower() == ".ast")
            {
                IsAst = true;
            }

            string ll_txt = Path.GetDirectoryName(fileName);

            ll_txt = Path.Combine(ll_txt, "LL.FIL");
            if (!File.Exists(ll_txt))
            {
                ll_txt = Path.Combine(ll_txt, "LL.TXT");
            }


            List <string> lstContent = new List <string>(File.ReadAllLines(fileName));

            bool      is_find = false;
            string    kStr    = "";
            MyStrings mList   = null;

            for (int i = 0; i < lstContent.Count; i++)
            {
                kStr = MyStrings.RemoveAllSpaces(lstContent[i]);

                if (kStr.StartsWith("N012"))
                {
                    kStr = MyStrings.RemoveAllSpaces(kStr.Replace("N012", ""));
                }

                if (kStr.Contains("LOAD GENE"))
                {
                    is_find = true;
                    list.Clear(); continue;
                }
                if (kStr.Contains("FINISH"))
                {
                    is_find = false;
                }
                if (is_find)
                {
                    try
                    {
                        mList = new MyStrings(kStr, ' ');
                        LoadGeneration lg = new LoadGeneration();
                        // 0   1    2  3  4     5   6
                        //TYPE 1 -18.8 0 9.75 XINC 0.2
                        lg.TypeNo = mList.GetInt(1);
                        lg.X      = mList.GetDouble(2);
                        lg.Y      = mList.GetDouble(3);
                        lg.Z      = mList.GetDouble(4);
                        lg.XINC   = mList.GetDouble(6);
                        lg.Moving_Wheel.ReadTypeDetails(ll_txt, lg.TypeNo);
                        Add(lg);
                    }
                    catch (Exception ex) { is_find = false; }
                }
            }
            return(true);
        }
Ejemplo n.º 7
0
        public static void DrawHrdrographFromDataFile(string data_file, vdDocument vdDoc)
        {
            List <HydroData> list_hydro_coll = new List <HydroData>();
            MyStrings        mlist           = null;
            List <string>    file_content    = new List <string>(File.ReadAllLines(data_file));
            string           kStr            = "";
            HydroData        hdr             = null;
            vdMText          mtext           = null;
            vdPolyline       pl   = null;
            vdCircle         cir  = null;
            vdRect           rect = null;

            double min_x, min_y;
            double max_x, max_y;


            min_x = double.MaxValue;
            min_y = min_x;
            max_x = double.MinValue;
            max_y = max_x;
            bool   flag = false;
            double min_foundation_Level = 0.0, Max_Scour_Depth = 0.0;

            foreach (var item in file_content)
            {
                kStr  = item.Replace(",", " ");
                kStr  = item.Replace("=", " ");
                kStr  = MyStrings.RemoveAllSpaces(kStr.ToUpper());
                mlist = new MyStrings(kStr, ' ');

                if (kStr.ToUpper().Contains("DISTANCE"))
                {
                    flag = true;
                }
                if (mlist.StringList[0] == "MIN_FOUNDATION_LEVEL")
                {
                    min_foundation_Level = mlist.GetDouble(1);
                }
                if (mlist.StringList[0] == "MAXIMUM_SCOUR_DEPTH")
                {
                    Max_Scour_Depth = mlist.GetDouble(1);
                }

                //sw.WriteLine("MIN_FOUNDATION_LEVEL = {0}", min_foundation_Level);
                //sw.WriteLine("MAXIMUM_SCOUR_DEPTH = {0}", Max_Scour_Depth);

                if (flag == false)
                {
                    continue;
                }
                try
                {
                    hdr          = new HydroData();
                    hdr.SerialNo = list_hydro_coll.Count + 1;


                    hdr.Distance = mlist.GetDouble(0, -999.0);
                    if (hdr.Distance == -999.0)
                    {
                        throw (new Exception());
                    }

                    hdr.WaterLevel = mlist.GetDouble(1);



                    list_hydro_coll.Add(hdr);

                    if (min_x > hdr.Distance)
                    {
                        min_x = hdr.Distance;
                    }
                    if (min_y > hdr.WaterLevel)
                    {
                        min_y = hdr.WaterLevel;
                    }

                    if (max_x < hdr.Distance)
                    {
                        max_x = hdr.Distance;
                    }
                    if (max_y < hdr.WaterLevel)
                    {
                        max_y = hdr.WaterLevel;
                    }
                }
                catch (Exception ex) { }
            }

            pl = new vdPolyline();
            pl.SetUnRegisterDocument(vdDoc);
            pl.setDocumentDefaults();



            foreach (var item in list_hydro_coll)
            {
                cir = new vdCircle();
                cir.SetUnRegisterDocument(vdDoc);
                cir.setDocumentDefaults();
                cir.Center   = new VectorDraw.Geometry.gPoint(item.Distance, item.WaterLevel);
                cir.Radius   = 0.09;
                cir.PenColor = new vdColor(Color.GreenYellow);
                vdDoc.ActiveLayOut.Entities.AddItem(cir);

                pl.VertexList.Add(cir.Center);
            }
            pl.PenColor = new vdColor(Color.Red);
            vdDoc.ActiveLayOut.Entities.AddItem(pl);


            vdLine ln_min_found = new vdLine();

            ln_min_found.SetUnRegisterDocument(vdDoc);
            ln_min_found.setDocumentDefaults();
            ln_min_found.StartPoint.x = pl.BoundingBox.Left;
            ln_min_found.StartPoint.y = pl.BoundingBox.Bottom - min_foundation_Level;

            ln_min_found.EndPoint.x = pl.BoundingBox.Right;
            ln_min_found.EndPoint.y = pl.BoundingBox.Bottom - min_foundation_Level;
            vdDoc.ActiveLayOut.Entities.AddItem(ln_min_found);


            mtext = new vdMText();
            mtext.SetUnRegisterDocument(vdDoc);
            mtext.setDocumentDefaults();
            mtext.InsertionPoint.x = ln_min_found.StartPoint.x;
            mtext.InsertionPoint.y = ln_min_found.StartPoint.y - 0.2;
            mtext.Height           = 0.3;
            //mtext.Rotation = 90 * Math.PI / 180.0;

            mtext.TextString = "Depth from LBL to minimum Foundation Level = " + min_foundation_Level.ToString("0.0000");
            mtext.PenColor   = new vdColor(Color.Cyan);
            vdDoc.ActiveLayOut.Entities.AddItem(mtext);



            vdLine ln_max_scour = new vdLine();

            ln_max_scour.SetUnRegisterDocument(vdDoc);
            ln_max_scour.setDocumentDefaults();
            ln_max_scour.StartPoint.x = pl.BoundingBox.Left;
            ln_max_scour.StartPoint.y = pl.BoundingBox.Bottom - Max_Scour_Depth;

            ln_max_scour.EndPoint.x = pl.BoundingBox.Right;
            ln_max_scour.EndPoint.y = pl.BoundingBox.Bottom - Max_Scour_Depth;
            vdDoc.ActiveLayOut.Entities.AddItem(ln_max_scour);



            mtext = new vdMText();
            mtext.SetUnRegisterDocument(vdDoc);
            mtext.setDocumentDefaults();
            mtext.InsertionPoint    = ln_max_scour.StartPoint;
            mtext.InsertionPoint.y -= 0.2;
            mtext.Height            = 0.3;
            //mtext.Rotation = 90 * Math.PI / 180.0;

            mtext.TextString = "Maximum Scour Depth obtained = " + Max_Scour_Depth.ToString("0.0000");
            mtext.PenColor   = new vdColor(Color.Cyan);
            vdDoc.ActiveLayOut.Entities.AddItem(mtext);

            //Maximum Scour Depth adopted =

            //Depth from LBL to minimum Foundation Level


            //vdRect rect = null;
            rect = new vdRect();
            rect.SetUnRegisterDocument(vdDoc);
            rect.setDocumentDefaults();

            rect.InsertionPoint.x = pl.BoundingBox.Left - 2;
            if (min_foundation_Level > Max_Scour_Depth)
            {
                rect.InsertionPoint.y = pl.BoundingBox.Bottom - 2 - min_foundation_Level;
            }
            else
            {
                rect.InsertionPoint.y = pl.BoundingBox.Bottom - 2 - Max_Scour_Depth;
            }

            rect.Width = pl.BoundingBox.Width + 4;
            //rect.Height = -pl.BoundingBox.Height;
            rect.Height = -2;

            vdDoc.ActiveLayOut.Entities.AddItem(rect);


            vdLine ln = new vdLine();

            ln.SetUnRegisterDocument(vdDoc);
            ln.setDocumentDefaults();
            ln.StartPoint.x = rect.BoundingBox.Left;
            ln.StartPoint.y = rect.BoundingBox.Bottom + 1;
            ln.EndPoint.x   = rect.BoundingBox.Right;
            ln.EndPoint.y   = rect.BoundingBox.Bottom + 1;

            vdDoc.ActiveLayOut.Entities.AddItem(ln);

            foreach (var item in list_hydro_coll)
            {
                mtext = new vdMText();
                mtext.SetUnRegisterDocument(vdDoc);
                mtext.setDocumentDefaults();
                mtext.InsertionPoint.x = item.Distance;
                mtext.InsertionPoint.y = ln.BoundingBox.Bottom + 0.2;
                mtext.Height           = 0.1;
                mtext.Rotation         = 90 * Math.PI / 180.0;

                mtext.TextString = item.WaterLevel.ToString("0.0000");
                mtext.PenColor   = new vdColor(Color.Cyan);
                vdDoc.ActiveLayOut.Entities.AddItem(mtext);


                mtext = new vdMText();
                mtext.SetUnRegisterDocument(vdDoc);
                mtext.setDocumentDefaults();
                mtext.InsertionPoint.x = item.Distance;
                mtext.InsertionPoint.y = rect.BoundingBox.Bottom + 0.2;
                mtext.Height           = 0.1;
                mtext.Rotation         = 90 * Math.PI / 180.0;

                mtext.TextString = item.Distance.ToString("0.0000");
                mtext.PenColor   = new vdColor(Color.LightGreen);
                vdDoc.ActiveLayOut.Entities.AddItem(mtext);
            }


            mtext = new vdMText();
            mtext.SetUnRegisterDocument(vdDoc);
            mtext.setDocumentDefaults();
            mtext.InsertionPoint.x = rect.BoundingBox.Left + 0.2;
            mtext.InsertionPoint.y = rect.BoundingBox.Top + 0.2;
            mtext.Height           = 0.11;
            //mtext.Rotation = 90 * Math.PI / 180.0;

            mtext.TextString = "DATUM = " + rect.BoundingBox.Top.ToString("0.00");
            vdDoc.ActiveLayOut.Entities.AddItem(mtext);

            mtext = new vdMText();
            mtext.SetUnRegisterDocument(vdDoc);
            mtext.setDocumentDefaults();
            mtext.InsertionPoint.x = rect.BoundingBox.Left + 0.2;
            mtext.InsertionPoint.y = ln.BoundingBox.Bottom + 0.5;
            mtext.Height           = 0.1;
            //mtext.Rotation = 90 * Math.PI / 180.0;

            mtext.TextString = "RIVER BED LEVEL (m)";
            mtext.PenColor   = new vdColor(Color.Cyan);
            vdDoc.ActiveLayOut.Entities.AddItem(mtext);


            mtext = new vdMText();
            mtext.SetUnRegisterDocument(vdDoc);
            mtext.setDocumentDefaults();
            mtext.InsertionPoint.x = rect.BoundingBox.Left + 0.2;
            mtext.InsertionPoint.y = rect.BoundingBox.Bottom + 0.5;
            mtext.Height           = 0.1;
            //mtext.Rotation = 90 * Math.PI / 180.0;

            mtext.TextString = "DISTANCE (m)";
            mtext.PenColor   = new vdColor(Color.LightGreen);
            vdDoc.ActiveLayOut.Entities.AddItem(mtext);


            ln = new vdLine();
            ln.SetUnRegisterDocument(vdDoc);
            ln.setDocumentDefaults();
            ln.StartPoint.x = rect.BoundingBox.Left + 1.8;
            ln.StartPoint.y = rect.BoundingBox.Bottom;
            ln.EndPoint.x   = rect.BoundingBox.Left + 1.8;
            ln.EndPoint.y   = rect.BoundingBox.Top;


            vdDoc.ActiveLayOut.Entities.AddItem(ln);

            vdRect over_box = new vdRect();

            over_box.SetUnRegisterDocument(vdDoc);
            over_box.setDocumentDefaults();

            over_box.InsertionPoint.x = rect.BoundingBox.Left - 2;
            over_box.InsertionPoint.y = rect.BoundingBox.Bottom - 1;

            over_box.Width  = rect.BoundingBox.Width + 4;
            over_box.Height = (pl.BoundingBox.Top - rect.BoundingBox.Bottom) + 2;

            vdDoc.ActiveLayOut.Entities.AddItem(over_box);

            VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VTop(vdDoc);
            vdDoc.Redraw(true);
        }
Ejemplo n.º 8
0
        private void SET_NodalDisplacement(string text)
        {
            NodeDisplacement nd    = new NodeDisplacement();
            MyStrings        mList = new MyStrings(MyStrings.RemoveAllSpaces(text), ' ');

            int indx = 0;

            if (mList.Count == 8)
            {
                indx           = 0;
                nd.Node.NodeNo = mList.GetInt(indx); indx++;
                lastNodeNo     = nd.Node.NodeNo;

                nd.LoadCase = mList.GetInt(indx); indx++;
                maxLoadCase = nd.LoadCase;

                nd.Tx = mList.GetDouble(indx); indx++;
                nd.Ty = mList.GetDouble(indx); indx++;
                nd.Tz = mList.GetDouble(indx); indx++;
                nd.Rx = mList.GetDouble(indx); indx++;
                nd.Ry = mList.GetDouble(indx); indx++;
                nd.Rz = mList.GetDouble(indx); indx++;
            }
            else if (mList.Count == 7)
            {
                indx           = 0;
                nd.Node.NodeNo = lastNodeNo;
                nd.LoadCase    = mList.GetInt(indx); indx++;
                maxLoadCase    = nd.LoadCase;

                nd.Tx = mList.GetDouble(indx); indx++;
                nd.Ty = mList.GetDouble(indx); indx++;
                nd.Tz = mList.GetDouble(indx); indx++;
                nd.Rx = mList.GetDouble(indx); indx++;
                nd.Ry = mList.GetDouble(indx); indx++;
                nd.Rz = mList.GetDouble(indx); indx++;
            }

            #region Calculate Proportionate
            /**/
            double x, y, z, prp, dif;

            x = y = z = prp = dif = 0.0;

            if (nd.Tx < nd.Ty && nd.Tx < nd.Tz)
            {
                x = nd.Tx;
                if (x < 1.0d)
                {
                    dif = 1.0d - x;
                    prp = x / dif;
                    x   = 1.0d;
                    y   = y * prp;
                    z   = z * prp;

                    //nd.Tx = x;
                    //nd.Ty += y;
                    //nd.Tz += z;
                }
            }
            else if (nd.Ty < nd.Tx && nd.Ty < nd.Tz)
            {
                y = nd.Ty;
                if (y < 1.0)
                {
                    dif = 1.0d - y;
                    prp = y / dif;
                    y   = 1.0d;
                    x   = x * prp;
                    z   = z * prp;


                    //nd.Tx += x;
                    //nd.Ty = y;
                    //nd.Tz += z;
                }
            }
            else if (nd.Tz < nd.Tx && nd.Tz < nd.Ty)
            {
                z = nd.Tz;
                if (z < 1.0d)
                {
                    dif = 1.0d - z;
                    prp = z / dif;
                    z   = 1.0d;
                    y   = y * prp;
                    x   = x * prp;

                    //nd.Tx += x;
                    //nd.Ty += y;
                    //nd.Tz = z;
                }
            }

            /*
             * if (nd.Tx > 0.0)
             * {
             *  nd.Tx += x;
             * }
             * else
             * {
             *  nd.Tx -= x;
             * }
             *
             * if (nd.Ty > 0.0)
             * {
             *  nd.Ty += y;
             * }
             * else
             * {
             *  nd.Tx -= y;
             * }
             *
             * if (nd.Tz > 0.0)
             * {
             *  nd.Tz += z;
             * }
             * else
             * {
             *  nd.Tz -= z;
             * }
             * /**/
            double factor = 1d;

            nd.Tx = nd.Tx * factor;
            nd.Ty = nd.Ty * factor;
            nd.Tz = nd.Tz * factor;
            #endregion

            //Chiranjit [2014 08 14]
            if (nd.Ty > 0)
            {
                nd.Ty = nd.Ty * -1;
            }



            ndispCol.Add(nd);
        }
Ejemplo n.º 9
0
        public void SetElementProperty(string propData)
        {
            //ELEMENT PROP
            //1 2 3 TH 0.5

            //ELEMENT PROPERTIES
            //1 2 3 TO 334 335 336 TH 0.07 DEN 0.0 Exx 3.00934e6  Exy 531061  Exg 0.0  Eyy 3.00934e6  Eyg 0.0  Gxy 1.23913e6

            int    thIndex = -1;
            int    indx = -1;
            double th, den;

            th = den = 0.0d;

            string temp = propData.TrimStart().TrimEnd().Trim().ToUpper().Replace("THICKNESS", "TH");

            MyStrings mLIst = new MyStrings(temp, ' ');

            thIndex = mLIst.StringList.IndexOf("TH");
            if (thIndex != -1)
            {
                th = mLIst.GetDouble(thIndex + 1);
            }
            indx = mLIst.StringList.IndexOf("DEN");
            if (indx != -1)
            {
                den = mLIst.GetDouble(indx + 1);
                mLIst.StringList.RemoveRange(indx + 2, (mLIst.StringList.Count - (indx + 2)));
            }

            //1 2 3 TO 334 335 336 TH 0.07 DEN 0.0 Exx 3.00934e6  Exy 531061  Exg 0.0  Eyy 3.00934e6  Eyg 0.0  Gxy 1.23913e6

            int toIndex = -1;

            if (mLIst.StringList.Contains("TO"))
            {
                while (mLIst.StringList.Contains("TO"))
                {
                    toIndex = mLIst.StringList.IndexOf("TO");
                    if (toIndex > 1)
                    {
                        for (int i = 0; i < (toIndex - 1); i++)
                        {
                            indx = IndexOf(mLIst.GetInt(i));
                            if (indx != -1)
                            {
                                this[indx].ThickNess = th.ToString();
                                this[indx].Density   = den.ToString();
                            }
                        }
                        mLIst.StringList.RemoveRange(0, toIndex - 2);
                    }
                    toIndex = mLIst.StringList.IndexOf("TO");
                    if (toIndex != -1)
                    {
                        for (int i = mLIst.GetInt(toIndex - 1); i <= mLIst.GetInt(toIndex + 1); i++)
                        {
                            this[IndexOf(i)].ThickNess = th.ToString();
                            this[IndexOf(i)].Density   = den.ToString();
                        }
                        mLIst.StringList.RemoveRange(0, toIndex + 2);
                    }
                }
            }
            //else
            //{
            thIndex = mLIst.StringList.IndexOf("TH");

            for (int i = 0; i < thIndex; i++)
            {
                indx = IndexOf(mLIst.GetInt(i));
                if (indx != -1)
                {
                    this[indx].ThickNess = th.ToString();
                    this[indx].Density   = den.ToString();
                }
            }
            //}
        }