Beispiel #1
0
        private void cmb_flr_lvl_SelectedIndexChanged(object sender, EventArgs e)
        {
            VDoc.ActiveLayOut.Entities.RemoveAll();
            VDoc.Redraw(true);

            panel1.Visible    = false;
            txt_beam_nos.Text = "";
        }
Beispiel #2
0
        public void Draw_Floor_Layout(double flr_lvl)
        {
            MemberIncidenceCollection beams = new MemberIncidenceCollection();

            for (int i = 0; i < AST_DOC.Members.Count; i++)
            {
                var item = AST_DOC.Members[i];

                if (item.EndNode.Y == flr_lvl)
                {
                    if (item.StartNode.Y == item.EndNode.Y)
                    {
                        beams.Add(item);
                    }
                }
            }



            VDoc.ShowUCSAxis = false;

            VDoc.ActiveLayOut.Entities.RemoveAll();

            double max_z = AST_DOC.Joints.Max_Z_Positive;
            vdLine ln    = new vdLine();

            foreach (var item in beams)
            {
                ln = new vdLine();

                ln.SetUnRegisterDocument(VDoc);
                ln.setDocumentDefaults();

                ln.StartPoint.x = item.StartNode.X;
                ln.StartPoint.y = max_z - item.StartNode.Z;

                ln.EndPoint.x = item.EndNode.X;
                ln.EndPoint.y = max_z - item.EndNode.Z;

                ln.ToolTip = "Member No : " + item.MemberNo;
                VDoc.ActiveLayOut.Entities.Add(ln);
            }

            //Get_Slabs(mic);
            Fill_All_Slab();
            Load_Slab_Data();

            VDoc.Palette.Background = Color.White;
            VDoc.Redraw(true);
            VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VTop(VDoc);
        }
Beispiel #3
0
 private void Set_TextSize()
 {
     foreach (var item in VDoc.ActionLayout.Entities)
     {
         if (item is vdMText)
         {
             vdMText t = item as vdMText;
             t.Height = TXT_SIZE;
             t.Update();
         }
         if (item is vdText)
         {
             vdText t = item as vdText;
             t.Height = TXT_SIZE;
             t.Update();
         }
     }
     VDoc.Redraw(true);
 }
Beispiel #4
0
        private void btn_OK_Click(object sender, EventArgs e)
        {
            MyStrings ml = new MyStrings(txt_beam_nos.Text.Trim(), ',');

            if (ml.Count > 0)
            {
                Slab_des.Beam_Nos = ml.StringList[0].Trim();
            }
            else
            {
                MessageBox.Show("Slab Members is not defined.", "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //Slab_des.Beam_Nos = txt_beam_nos.Text;
            Slab_des.case_index = cmb_slab_type.SelectedIndex;

            Slab_des.D     = MyStrings.StringToDouble(txt_slab_D.Text, 0.0);
            Slab_des.fck   = MyStrings.StringToDouble(cmb_slab_fck.Text.Replace("M", ""), 0.0);
            Slab_des.gamma = MyStrings.StringToDouble(txt_slab_gamma.Text, 0.0);
            Slab_des.fy    = MyStrings.StringToDouble(cmb_slab_fy.Text.Replace("Fe", ""), 0.0);
            Slab_des.wll   = MyStrings.StringToDouble(txt_slab_wll.Text, 0.0);
            Slab_des.d1    = MyStrings.StringToDouble(txt_slab_d1.Text, 0.0);
            Slab_des.s1    = MyStrings.StringToDouble(txt_slab_s1.Text, 0.0);
            Slab_des.d2    = MyStrings.StringToDouble(txt_slab_d2.Text, 0.0);
            Slab_des.s2    = MyStrings.StringToDouble(txt_slab_s2.Text, 0.0);
            Slab_des.d3    = MyStrings.StringToDouble(txt_slab_d3.Text, 0.0);
            Slab_des.s3    = MyStrings.StringToDouble(txt_slab_s3.Text, 0.0);
            Slab_des.d4    = MyStrings.StringToDouble(txt_slab_d4.Text, 0.0);
            Slab_des.s4    = MyStrings.StringToDouble(txt_slab_s4.Text, 0.0);
            Slab_des.cover = MyStrings.StringToDouble(txt_slab_c.Text, 0.0);
            Slab_des.dlf   = MyStrings.StringToDouble(txt_slab_DLF.Text, 0.0);
            Slab_des.llf   = MyStrings.StringToDouble(txt_slab_LLF.Text, 0.0);

            Slab_des.dgv_dls = dgv_dls;
            #region Check Beam Members


            MyStrings mlist = new MyStrings(txt_beam_nos.Text.Trim(), ' ');

            MemberIncidenceCollection mic = new MemberIncidenceCollection();

            for (int i = 0; i < mlist.Count; i++)
            {
                mic.Add(AST_DOC.Members.Get_Member(mlist.GetInt(i)));
            }


            JointCoordinateCollection jntc = new JointCoordinateCollection();

            for (int i = 1; i < mic.Count; i++)
            {
                if (mic[i - 1].StartNode == mic[i].StartNode)
                {
                    if (!jntc.Contains(mic[i].StartNode))
                    {
                        jntc.Add(mic[i].StartNode);
                    }
                }
                else if (mic[i - 1].EndNode == mic[i].StartNode)
                {
                    if (!jntc.Contains(mic[i].StartNode))
                    {
                        jntc.Add(mic[i].StartNode);
                    }
                }
                else if (mic[i - 1].StartNode == mic[i].EndNode)
                {
                    if (!jntc.Contains(mic[i].EndNode))
                    {
                        jntc.Add(mic[i].EndNode);
                    }
                }
                else if (mic[i - 1].EndNode == mic[i].EndNode)
                {
                    if (!jntc.Contains(mic[i].EndNode))
                    {
                        jntc.Add(mic[i].EndNode);
                    }
                }
                else
                {
                    //string ss = Slab_Data[beam_nos] as string;
                    //if (ss != null)
                    //    Slab_Data.Remove(beam_nos);
                    //Save_Data();
                    MessageBox.Show("Beam " + mic[i].MemberNo + " and Beam " + mic[i - 1].MemberNo + " Joints are mismatch..", "ASTRA", MessageBoxButtons.OK);
                    return;
                }
            }

            #endregion  Check Beam Members
            //Chiranjit [2015 04 26]
            //Slab_des.Calculate_Program();
            Slab_des.Design_Program();


            List <string> Design_Summary = new List <string>();

            Design_Summary.Add(string.Format("-------------------------------------"));
            Design_Summary.Add(string.Format("SLAB MEMBERS = {0}", Slab_des.Beam_Nos));
            Design_Summary.Add(string.Format("SLAB FLOOR LEVEL = {0} M", cmb_flr_lvl.Text));
            Design_Summary.AddRange(Slab_des.Design_Summary.ToArray());
            Design_Summary.Add(string.Format("-------------------------------------"));


            string fnm = Slab_des.Get_Design_Summary_File(Slab_des.Beam_Nos, cmb_flr_lvl.Text);
            //fnm = Path.Combine(Path.GetDirectoryName(fnm), "SLAB_DESIGN_SUMMARY.TXT");

            //if (File.Exists(fnm))
            //    Design_Summary.AddRange(File.ReadAllLines(fnm));

            File.WriteAllLines(fnm, Design_Summary.ToArray());

            Save_Data();
            //Fill_Slab(txt_beam_nos.Text, Slab_des.IS_DESIGN_OK);
            Fill_All_Slab();

            Add_Slab_Boq(Slab_des.BOQ);



            GetGripSelection(false).RemoveAll();

            if (File.Exists(Slab_des.Report_File))
            {
                MessageBox.Show(this, "Report file created in file " + Slab_des.Report_File, "ASTRA", MessageBoxButtons.OK);
                frmASTRAReport.OpenReport(Slab_des.Report_File, this, false);
            }
            VDoc.Redraw(true);

            //this.DialogResult = DialogResult.OK;
            //this.Close();
        }
Beispiel #5
0
        private void Fill_Slab(string beam_nos, bool isOk)
        {
            MyStrings mlist = new MyStrings(beam_nos.Trim(), ' ');

            MemberIncidenceCollection mic = new MemberIncidenceCollection();


            for (int i = 0; i < mlist.Count; i++)
            {
                mic.Add(AST_DOC.Members.Get_Member(mlist.GetInt(i)));
            }



            JointCoordinateCollection jntc = new JointCoordinateCollection();

            vdPolyline vdpl = new vdPolyline();

            vdpl.SetUnRegisterDocument(VDoc);
            vdpl.setDocumentDefaults();

            for (int i = 1; i < mic.Count; i++)
            {
                if (mic[i - 1].StartNode == mic[i].StartNode)
                {
                    if (!jntc.Contains(mic[i].StartNode))
                    {
                        jntc.Add(mic[i].StartNode);
                    }
                }
                else if (mic[i - 1].EndNode == mic[i].StartNode)
                {
                    if (!jntc.Contains(mic[i].StartNode))
                    {
                        jntc.Add(mic[i].StartNode);
                    }
                }
                else if (mic[i - 1].StartNode == mic[i].EndNode)
                {
                    if (!jntc.Contains(mic[i].EndNode))
                    {
                        jntc.Add(mic[i].EndNode);
                    }
                }
                else if (mic[i - 1].EndNode == mic[i].EndNode)
                {
                    if (!jntc.Contains(mic[i].EndNode))
                    {
                        jntc.Add(mic[i].EndNode);
                    }
                }
                else
                {
                    //string ss = Slab_Data[beam_nos] as string;
                    //if (ss != null)
                    //    Slab_Data.Remove(beam_nos);

                    //Save_Data();
                    MessageBox.Show("Beam " + mic[i].MemberNo + " and Beam " + mic[i - 1].MemberNo + " Joints are mismatch..", "ASTRA", MessageBoxButtons.OK);
                    return;
                }
            }

            if (!jntc.Contains(mic[0].StartNode))
            {
                jntc.Add(mic[0].StartNode);
            }
            if (!jntc.Contains(mic[0].EndNode))
            {
                jntc.Add(mic[0].EndNode);
            }

            jntc.Add(jntc[0]);
            double max_z = AST_DOC.Joints.Max_Z_Positive;

            foreach (var item in jntc)
            {
                //vdpl.VertexList.Add(item.Point);
                vdpl.VertexList.Add(new gPoint(item.X, max_z - item.Z));
            }


            //if (File.Exists(Slab_des.Get_Report_File(beam_nos, cmb_flr_lvl.Text)))
            //{
            //    vdpl.ToolTip = File.ReadAllText(Slab_des.Get_Report_File(beam_nos, cmb_flr_lvl.Text));
            //    vdpl.ToolTip = "



            //}

            vdpl.ToolTip = "Member surrounded : " + beam_nos;

            vdLayer vlay = VDoc.Layers.FindName("slab");


            if (vlay == null)
            {
                vlay = new vdLayer(VDoc, "slab");
                vlay.SetUnRegisterDocument(VDoc);
                vlay.setDocumentDefaults();


                VDoc.Layers.Add(vlay);
            }

            //vlay.Frozen = false;
            //vlay.Lock = true;
            vdpl.Layer = vlay;


            //vdpl.PenColor = new vdColor(Color.DarkGray);
            if (isOk)
            {
                vdpl.PenColor = new vdColor(Color.Green);
            }
            else
            {
                vdpl.PenColor = new vdColor(Color.Red);
            }
            vdpl.HatchProperties = new vdHatchProperties(VectorDraw.Professional.Constants.VdConstFill.VdFillModeHatchFDiagonal);


            //vdpl.ExtrusionVector = new Vector(0.0, 1.0, 0.0);


            VDoc.ActiveLayOut.Entities.Add(vdpl);

            VDoc.ActiveLayOut.Entities.ChangeOrder(vdpl, true);

            VDoc.Redraw(true);
        }