Ejemplo n.º 1
0
        private void frmJoints_Load(object sender, EventArgs e)
        {
            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0];


                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');


                int r = MyStrings.StringToInt(kStr, -1);
                if (r == -1)
                {
                    r = DGV.CurrentCell.RowIndex;
                    btn_jnt_add.Text      = "Insert";
                    txt_jnt_start_no.Text = DGV[0, r].Value.ToString();
                }
                else
                {
                    txt_jnt_start_no.Text = DGV[0, r].Value.ToString();
                    txt_jnt_start_x.Text  = DGV[1, r].Value.ToString();
                    txt_jnt_start_y.Text  = DGV[2, r].Value.ToString();
                    txt_jnt_start_z.Text  = DGV[3, r].Value.ToString();
                    btn_jnt_add.Text      = "Change";
                }
            }
            else
            {
                txt_jnt_start_no.Text = DGV.RowCount + 1 + "";

                txt_jnt_start_x.Text = "0.0";
                txt_jnt_start_y.Text = "0.0";
                txt_jnt_start_z.Text = "0.0";
            }
        }
Ejemplo n.º 2
0
 private void btn_add_Click(object sender, EventArgs e)
 {
     LDC.LoadNo = MyStrings.StringToInt(txt_load_no.Text, 0);
     LDC.Name   = txt_load_name.Text;
     LDC.LoadCases.Clear();
     LDC.Factors.Clear();
     for (int i = 0; i < dgv_combinations.RowCount; i++)
     {
         LDC.LoadCases.Add(MyStrings.StringToInt(dgv_combinations[0, i].Value.ToString().ToUpper().Replace("LOAD CASE ", ""), 0));
         LDC.Factors.Add(MyStrings.StringToDouble(dgv_combinations[1, i].Value.ToString(), 0));
     }
     LDC.Set_Combination();
     this.Close();
 }
Ejemplo n.º 3
0
        public void Draw_Elements()
        {
            //Clear_All();
            ASTRADoc astdoc;

            //astdoc = new ASTRADoc(iACad.AstraDocument);
            astdoc = (iACad.AstraDocument);


            astdoc.Elements.Clear();

            for (int i = 0; i < DGV.Rows.Count; i++)
            {
                Element elm = new Element();
                DGV[0, i].Value = i + 1;

                //jn.NodeNo = MyList.StringToInt(DGV[0, i].Value.ToString(), 0);
                elm.ElementNo    = MyStrings.StringToInt(DGV[0, i].Value.ToString(), 0);
                elm.Node1.NodeNo = MyStrings.StringToInt(DGV[1, i].Value.ToString(), 0);
                elm.Node2.NodeNo = MyStrings.StringToInt(DGV[2, i].Value.ToString(), 0);
                elm.Node3.NodeNo = MyStrings.StringToInt(DGV[3, i].Value.ToString(), 0);
                elm.Node4.NodeNo = MyStrings.StringToInt(DGV[4, i].Value.ToString(), 0);

                astdoc.Elements.Add(elm);
            }
            //iACad.Document.ActiveLayOut.Entities.EraseAll();

            foreach (var item in iACad.Document.ActionLayout.Entities)
            {
                if (item is vdFigure)
                {
                    vdFigure vf = item as vdFigure;
                    if (vf.Layer.Name == "Elements")
                    {
                        vf.Deleted = true;
                    }
                }
            }
            iACad.Document.Redraw(true);

            astdoc.Elements.CopyCoordinates(astdoc.Joints);
            astdoc.Elements.DrawElements(iACad.Document);

            //iACad.AstraDocument = astdoc;

            //AST_DOC.Members.DrawMember(VDoc);
            //AST_DOC.Elements.DrawElements(VDoc);
            //AST_DOC.Supports.DrawSupport(VDoc);
        }
Ejemplo n.º 4
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            LLD = new LiveLoad();

            MyStrings mlist = new MyStrings(cmb_Ana_load_type.Text, ':');

            LLD.Type          = MyStrings.StringToInt(mlist.StringList[0].Replace("TYPE ", ""), 0);
            LLD.X_Distance    = MyStrings.StringToDouble(txt_Ana_X.Text, 0.0);
            LLD.Y_Distance    = MyStrings.StringToDouble(txt_Ana_DL_Y.Text, 0.0);
            LLD.Z_Distance    = MyStrings.StringToDouble(txt_Ana_DL_Z.Text, 0.0);
            LLD.X_Increment   = MyStrings.StringToDouble(txt_XINCR.Text, 0.0);
            LLD.Impact_Factor = MyStrings.StringToDouble(txt_Load_Impact.Text, 1.0);

            this.Close();
        }
Ejemplo n.º 5
0
        private void frmElements_Load(object sender, EventArgs e)
        {
            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0];


                MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');


                int r = MyStrings.StringToInt(kStr, -1);
                if (r == -1)
                {
                    r = DGV.CurrentCell.RowIndex;
                    btn_elmt_add.Text = "Insert";
                    txt_elmt_no.Text  = DGV[0, r].Value.ToString();
                }
                else
                {
                    txt_elmt_no.Text    = DGV[0, r].Value.ToString();
                    txt_elmt_node1.Text = DGV[1, r].Value.ToString();
                    txt_elmt_node2.Text = DGV[2, r].Value.ToString();
                    txt_elmt_node3.Text = DGV[3, r].Value.ToString();
                    txt_elmt_node4.Text = DGV[4, r].Value.ToString();
                    btn_elmt_add.Text   = "Change";
                }
            }
            else
            {
                txt_elmt_no.Text = DGV.RowCount + 1 + "";

                List <int> joints = MyStrings.Get_Array_Intiger(iACad.GetSelectedJointsInText());

                if (joints.Count > 3)
                {
                    txt_elmt_node1.Text = joints[0].ToString();
                    txt_elmt_node2.Text = joints[1].ToString();
                    txt_elmt_node3.Text = joints[2].ToString();
                    txt_elmt_node4.Text = joints[3].ToString();
                }

                //txt_elmt_node1.Text = "0";
                //txt_elmt_node2.Text = "0.0";
                //txt_jnt_start_z.Text = "0.0";
            }
        }
Ejemplo n.º 6
0
        public void Draw_Joints()
        {
            //Clear_All();
            ASTRADoc astdoc;

            //astdoc = new ASTRADoc(iACad.AstraDocument);
            astdoc = (iACad.AstraDocument);


            astdoc.Joints.Clear();

            for (int i = 0; i < DGV.Rows.Count; i++)
            {
                JointCoordinate jn = new JointCoordinate();
                DGV[0, i].Value = i + 1;

                //jn.NodeNo = MyList.StringToInt(DGV[0, i].Value.ToString(), 0);
                jn.NodeNo  = MyStrings.StringToInt(DGV[0, i].Value.ToString(), 0);
                jn.Point.x = MyStrings.StringToDouble(DGV[1, i].Value.ToString(), 0.0);
                jn.Point.y = MyStrings.StringToDouble(DGV[2, i].Value.ToString(), 0.0);
                jn.Point.z = MyStrings.StringToDouble(DGV[3, i].Value.ToString(), 0.0);
                astdoc.Joints.Add(jn);
            }
            //iACad.Document.ActiveLayOut.Entities.EraseAll();

            foreach (var item in iACad.Document.ActionLayout.Entities)
            {
                if (item is vdFigure)
                {
                    vdFigure vf = item as vdFigure;
                    if (vf.Layer.Name == "Nodes")
                    {
                        vf.Deleted = true;
                    }
                }
            }
            iACad.Document.Redraw(true);

            astdoc.Joints.DrawJointsText(iACad.Document, 0.3);

            //iACad.AstraDocument = astdoc;

            //AST_DOC.Members.DrawMember(VDoc);
            //AST_DOC.Elements.DrawElements(VDoc);
            //AST_DOC.Supports.DrawSupport(VDoc);
        }
Ejemplo n.º 7
0
        private void btn_jload_add_Click(object sender, EventArgs e)
        {
            string kStr = "";

            //kStr = "LOAD " + txt_load_case.Text + " : " + txt_load_title.Text.Replace(',', ' ');
            kStr = txt_load_case.Text + " : " + txt_load_title.Text.Replace(',', ' ');

            ASTRA_Data = kStr;



            Ld        = new LoadCaseDefinition();
            Ld.LoadNo = MyStrings.StringToInt(txt_load_case.Text, 0);
            Ld.Title  = txt_load_title.Text;



            this.Close();
        }
Ejemplo n.º 8
0
        private void btn_new_Click(object sender, EventArgs e)
        {
            string txt_loads     = "";
            string txt_distances = "";

            for (int i = 0; i < dgv_loads.RowCount - 1; i++)
            {
                txt_loads     += dgv_loads[1, i].Value + " ";
                txt_distances += dgv_loads[2, i].Value + " ";
            }

            MLD           = new MovingLoadData();
            MLD.Type      = MyStrings.StringToInt(txt_type.Text, 0);
            MLD.Name      = txt_lm.Text;
            MLD.Loads     = txt_loads;
            MLD.Distances = txt_distances;
            MLD.LoadWidth = MyStrings.StringToDouble(txt_load_width.Text, 0);
            //Load
            this.Close();
        }
Ejemplo n.º 9
0
        private void btn_create_Click_1(object sender, EventArgs e)
        {
            //iACad.AstraDocument
            StructureMemberAnalysis Str_Analysis = new StructureMemberAnalysis(iACad.AstraDocument.AnalysisFileName);

            List <JointForce> jn_Force = Str_Analysis.list_joints;

            int loadno = ALL_Loads.Count + 1;

            List <string> jloads = new List <string>();
            int           i      = 0;


            int load_eqx = loadno;
            int load_eqz = loadno;

            if (Direction != 6)
            {
                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD EQX", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}", jn_Force[i].NodeNo,
                                             "FX",
                                             jn_Force[i].FY * SC));
                }
            }


            if (Direction != 5)
            {
                loadno++;
                load_eqz = loadno;

                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD EQZ", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}",
                                             jn_Force[i].NodeNo,
                                             "FZ",
                                             jn_Force[i].FY * SC));
                }
            }
            //jloads.Add(string.Format("{0} {1} {2:f3}", jn_Force[i].NodeNo, dir, jn_Force[i].FY * sc));

            //LDC.LoadNo = MyStrings.StringToInt(txt_load_no.Text, 0);
            //loadno++;
            LDC.LoadNo = loadno;
            LDC.Name   = txt_load_name.Text;
            LDC.LoadCases.Clear();
            LDC.Factors.Clear();
            for (i = 0; i < dgv_combinations.RowCount; i++)
            {
                LDC.LoadCases.Add(MyStrings.StringToInt(dgv_combinations[0, i].Value.ToString().ToUpper().Replace("LOAD CASE ", ""), 0));
                LDC.Factors.Add(MyStrings.StringToDouble(dgv_combinations[1, i].Value.ToString(), 0));
            }

            //LDC.LoadCases.Add(LDC.LoadNo);
            //LDC.Factors.Add(MyStrings.StringToDouble(textBox1.Text, 0));

            LDC.Set_Combination();


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

            //load_combs.Add(string.Format("LOAD COMB {0} SEISMIC COMB", loadno));
            if (Direction == 1 || Direction == 3 || Direction == 5)
            {
                loadno++;
                load_combs.Add(string.Format("LOAD COMB {0} {1} (DL+EQX)", loadno, textBox1.Text));
                load_combs.Add(string.Format("{0} {1} {2}", LDC.Data, load_eqx, textBox1.Text));
                //load_combs.Add(LDC.Data);
            }

            if (Direction == 2 || Direction == 4 || Direction == 5)
            {
                loadno++;
                //load_combs.Add(string.Format("LOAD COMB {0} SEISMIC COMB", loadno));
                load_combs.Add(string.Format("LOAD COMB {0} {1} (DL-EQX)", loadno, textBox1.Text));
                load_combs.Add(string.Format("{0} {1} -{2}", LDC.Data, load_eqx, textBox1.Text));
            }


            if (Direction == 1 || Direction == 4 || Direction == 6)
            {
                loadno++;
                //load_combs.Add(string.Format("LOAD COMB {0} SEISMIC COMB", loadno));
                load_combs.Add(string.Format("LOAD COMB {0} {1} (DL+EQZ)", loadno, textBox1.Text));
                load_combs.Add(string.Format("{0} {1} {2}", LDC.Data, load_eqz, textBox1.Text));
                //load_combs.Add(LDC.Data);
            }

            if (Direction == 2 || Direction == 3 || Direction == 6)
            {
                loadno++;
                //load_combs.Add(string.Format("LOAD COMB {0} SEISMIC COMB", loadno));
                load_combs.Add(string.Format("LOAD COMB {0} {1} (DL-EQZ)", loadno, textBox1.Text));
                load_combs.Add(string.Format("{0} {1} -{2}", LDC.Data, load_eqz, textBox1.Text));
                //load_combs.Add(LDC.Data);
            }



            string file_name = File_Seismic_Load;


            if (file_name == "")
            {
                file_name = Path.Combine(Path.GetDirectoryName(Str_Analysis.Analysis_File), "Seismic_Analysis");
                if (!Directory.Exists(file_name))
                {
                    Directory.CreateDirectory(file_name);
                }
                file_name = Path.Combine(file_name, "Seismic_Analysis.TXT");
            }
            File.WriteAllText(file_name, "Write Data");



            if (Write_Seismic_Data != null)
            {
                Write_Seismic_Data(jloads, load_combs, file_name);
                RunAnalysis(file_name);
            }

            this.DialogResult = DialogResult.OK;

            this.Close();
        }
Ejemplo n.º 10
0
        private void btn_create_Click(object sender, EventArgs e)
        {
            if (dgv_combinations.RowCount == 0)
            {
                MessageBox.Show("Add a Load Definition.", "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            //iACad.AstraDocument
            if (Str_Analysis == null)
            {
                Str_Analysis = new StructureMemberAnalysis(iACad.AstraDocument.AnalysisFileName);
            }

            List <JointForce> jn_Force = Str_Analysis.list_joints;

            int loadno = ALL_Loads.Count + 1;

            List <string> jloads = new List <string>();
            int           i      = 0;


            int load_eqx = loadno;
            int load_eqz = loadno;


            #region Chiranjit [2015 05 27]
            #endregion Chiranjit [2015 05 27]


            int sign_x = 1, sign_z = 1;


            switch (Direction)
            {
            case 1:     //+X/+Z

                #region //+X/+Z
                sign_x = 1;
                sign_z = 1;

                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD +EQX", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}", jn_Force[i].NodeNo,
                                             "FX",
                                             sign_x * Math.Abs(jn_Force[i].FY) * SC));
                }


                loadno++;
                load_eqz = loadno;

                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD +EQZ", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}",
                                             jn_Force[i].NodeNo,
                                             "FZ",
                                             sign_z * Math.Abs(jn_Force[i].FY) * SC));
                }
                #endregion     //+X/+Z

                break;

            case 2:     //-X/-Z

                #region -X/-Z
                sign_x = -1;
                sign_z = -1;

                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD -EQX", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}", jn_Force[i].NodeNo,
                                             "FX",
                                             sign_x * Math.Abs(jn_Force[i].FY) * SC));
                }


                loadno++;
                load_eqz = loadno;

                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD -EQZ", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}",
                                             jn_Force[i].NodeNo,
                                             "FZ",
                                             sign_z * Math.Abs(jn_Force[i].FY) * SC));
                }
                #endregion     //+X/+Z

                break;


            case 3:     //  +X/-Z

                #region +X/-Z
                sign_x = 1;
                sign_z = -1;

                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD +EQX", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}", jn_Force[i].NodeNo,
                                             "FX",
                                             sign_x * Math.Abs(jn_Force[i].FY) * SC));
                }


                loadno++;
                load_eqz = loadno;

                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD -EQZ", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}",
                                             jn_Force[i].NodeNo,
                                             "FZ",
                                             sign_z * Math.Abs(jn_Force[i].FY) * SC));
                }
                #endregion     //+X/+Z

                break;

            case 4:     //  -X/+Z

                #region -X/+Z
                sign_x = -1;
                sign_z = 1;

                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD -EQX", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}", jn_Force[i].NodeNo,
                                             "FX",
                                             sign_x * Math.Abs(jn_Force[i].FY) * SC));
                }


                loadno++;
                load_eqz = loadno;

                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD +EQZ", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}",
                                             jn_Force[i].NodeNo,
                                             "FZ",
                                             sign_z * Math.Abs(jn_Force[i].FY) * SC));
                }
                #endregion     //+X/+Z

                break;


            case 5:     //  +X/-X

                #region +X/-X
                sign_x = 1;
                sign_z = -1;

                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD +EQX", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}", jn_Force[i].NodeNo,
                                             "FX",
                                             sign_x * Math.Abs(jn_Force[i].FY) * SC));
                }


                loadno++;
                load_eqz = loadno;

                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD -EQX", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}",
                                             jn_Force[i].NodeNo,
                                             "FX",
                                             sign_z * Math.Abs(jn_Force[i].FY) * SC));
                }
                #endregion     //+X/+Z

                break;


            case 6:     //  +Z/-Z

                #region   +Z/-Z
                sign_x = 1;
                sign_z = -1;

                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD +EQZ", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}", jn_Force[i].NodeNo,
                                             "FZ",
                                             sign_x * Math.Abs(jn_Force[i].FY) * SC));
                }


                loadno++;
                load_eqz = loadno;

                jloads.Add(string.Format("LOAD {0} SEISMIC LOAD -EQZ", loadno));
                jloads.Add(string.Format("JOINT LOAD"));
                for (i = 0; i < jn_Force.Count; i++)
                {
                    jloads.Add(string.Format("{0} {1} {2:f3}",
                                             jn_Force[i].NodeNo,
                                             "FZ",
                                             sign_z * Math.Abs(jn_Force[i].FY) * SC));
                }
                #endregion     //+X/+Z

                break;
            }

            //switch (Direction)
            //{
            //    case 1: //+X/+Z
            //        jloads.Add(string.Format("LOAD {0} SEISMIC LOAD EQX", loadno));
            //        jloads.Add(string.Format("JOINT LOAD"));
            //        for (i = 0; i < jn_Force.Count; i++)
            //        {
            //            jloads.Add(string.Format("{0} {1} {2:f3}", jn_Force[i].NodeNo,
            //                "FX",
            //               Math.Abs(jn_Force[i].FY) * SC));
            //        }


            //        loadno++;
            //        load_eqz = loadno;

            //        jloads.Add(string.Format("LOAD {0} SEISMIC LOAD EQZ", loadno));
            //        jloads.Add(string.Format("JOINT LOAD"));
            //        for (i = 0; i < jn_Force.Count; i++)
            //        {
            //            jloads.Add(string.Format("{0} {1} {2:f3}",
            //                jn_Force[i].NodeNo,
            //                "FZ",
            //                Math.Abs(jn_Force[i].FY) * SC));
            //        }
            //        break;
            //}



            //if (Direction != 6)
            //{
            //    jloads.Add(string.Format("LOAD {0} SEISMIC LOAD EQX", loadno));
            //    jloads.Add(string.Format("JOINT LOAD"));
            //    for (i = 0; i < jn_Force.Count; i++)
            //    {
            //        jloads.Add(string.Format("{0} {1} {2:f3}", jn_Force[i].NodeNo,
            //            "FX",
            //            jn_Force[i].FY * SC));
            //    }
            //}


            //if (Direction != 5)
            //{
            //    loadno++;
            //    load_eqz = loadno;

            //    jloads.Add(string.Format("LOAD {0} SEISMIC LOAD EQZ", loadno));
            //    jloads.Add(string.Format("JOINT LOAD"));
            //    for (i = 0; i < jn_Force.Count; i++)
            //    {
            //        jloads.Add(string.Format("{0} {1} {2:f3}",
            //            jn_Force[i].NodeNo,
            //            "FZ",
            //            jn_Force[i].FY * SC));
            //    }
            //}
            //jloads.Add(string.Format("{0} {1} {2:f3}", jn_Force[i].NodeNo, dir, jn_Force[i].FY * sc));

            //LDC.LoadNo = MyStrings.StringToInt(txt_load_no.Text, 0);
            //loadno++;
            LDC.LoadNo = loadno;
            LDC.Name   = txt_load_name.Text;
            LDC.LoadCases.Clear();
            LDC.Factors.Clear();
            for (i = 0; i < dgv_combinations.RowCount; i++)
            {
                LDC.LoadCases.Add(MyStrings.StringToInt(dgv_combinations[0, i].Value.ToString().ToUpper().Replace("LOAD CASE ", ""), 0));
                LDC.Factors.Add(MyStrings.StringToDouble(dgv_combinations[1, i].Value.ToString(), 0));
            }

            //LDC.LoadCases.Add(LDC.LoadNo);
            //LDC.Factors.Add(MyStrings.StringToDouble(textBox1.Text, 0));

            LDC.Set_Combination();


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

            //load_combs.Add(string.Format("LOAD COMB {0} SEISMIC COMB", loadno));
            if (Direction == 1 || Direction == 3 || Direction == 5)
            {
                loadno++;
                load_combs.Add(string.Format("LOAD COMB {0} {1} (DL+EQX)", loadno, textBox1.Text));
                load_combs.Add(string.Format("{0} {1} {2}", LDC.Data, load_eqx, textBox1.Text));
                //load_combs.Add(LDC.Data);
            }

            if (Direction == 2 || Direction == 4)
            {
                loadno++;
                //load_combs.Add(string.Format("LOAD COMB {0} SEISMIC COMB", loadno));
                load_combs.Add(string.Format("LOAD COMB {0} {1} (DL-EQX)", loadno, textBox1.Text));
                //load_combs.Add(string.Format("{0} {1} -{2}", LDC.Data, load_eqx, textBox1.Text));
                load_combs.Add(string.Format("{0} {1} {2}", LDC.Data, load_eqx, textBox1.Text));
            }


            if (Direction == 5)
            {
                loadno++;
                //load_combs.Add(string.Format("LOAD COMB {0} SEISMIC COMB", loadno));
                load_combs.Add(string.Format("LOAD COMB {0} {1} (DL-EQX)", loadno, textBox1.Text));
                load_combs.Add(string.Format("{0} {1} {2}", LDC.Data, load_eqz, textBox1.Text));
            }


            if (Direction == 1 || Direction == 4)
            {
                loadno++;
                //load_combs.Add(string.Format("LOAD COMB {0} SEISMIC COMB", loadno));
                load_combs.Add(string.Format("LOAD COMB {0} {1} (DL+EQZ)", loadno, textBox1.Text));
                load_combs.Add(string.Format("{0} {1} {2}", LDC.Data, load_eqz, textBox1.Text));
                //load_combs.Add(LDC.Data);
            }

            if (Direction == 2 || Direction == 3)
            {
                loadno++;
                //load_combs.Add(string.Format("LOAD COMB {0} SEISMIC COMB", loadno));
                load_combs.Add(string.Format("LOAD COMB {0} {1} (DL-EQZ)", loadno, textBox1.Text));
                //load_combs.Add(string.Format("{0} {1} -{2}", LDC.Data, load_eqz, textBox1.Text));
                load_combs.Add(string.Format("{0} {1} {2}", LDC.Data, load_eqz, textBox1.Text));
                //load_combs.Add(LDC.Data);
            }
            if (Direction == 6)
            {
                loadno++;
                //load_combs.Add(string.Format("LOAD COMB {0} SEISMIC COMB", loadno));
                load_combs.Add(string.Format("LOAD COMB {0} {1} (DL+EQZ)", loadno, textBox1.Text));
                load_combs.Add(string.Format("{0} {1} {2}", LDC.Data, load_eqx, textBox1.Text));

                loadno++;
                //load_combs.Add(string.Format("LOAD COMB {0} SEISMIC COMB", loadno));
                load_combs.Add(string.Format("LOAD COMB {0} {1} (DL-EQZ)", loadno, textBox1.Text));
                load_combs.Add(string.Format("{0} {1} {2}", LDC.Data, load_eqz, textBox1.Text));
                //load_combs.Add(LDC.Data);
            }

            string file_name         = File_Seismic_Load;


            if (file_name == "")
            {
                file_name = Path.Combine(Path.GetDirectoryName(Str_Analysis.Analysis_File), "Seismic_Analysis");
                if (!Directory.Exists(file_name))
                {
                    Directory.CreateDirectory(file_name);
                }
                file_name = Path.Combine(file_name, "Seismic_Analysis.TXT");
            }
            File.WriteAllText(file_name, "Write Data");

            if (Write_Seismic_Data != null)
            {
                Write_Seismic_Data(jloads, load_combs, file_name);
            }


            btn_process.Enabled = true;
            btn_view.Enabled    = true;
        }
Ejemplo n.º 11
0
        public void Load_Floor_Levels()
        {
            if (DGV_Joints == null)
            {
                return;
            }

            BeamTable        = new Hashtable();
            AllColumn        = new List <int>();
            selected_beams   = new List <int>();
            selected_columns = new List <int>();


            List <double> flvls = new List <double>();

            double d = 0.0;
            //JointCoordinateCollection
            //MemberIncidenceCollection
            MemberIncidence mi = new MemberIncidence();
            //MemberIncidenceCollection mic = new MemberIncidenceCollection();
            JointCoordinate jc = new JointCoordinate();
            //JointCoordinateCollection jcc = new JointCoordinateCollection();


            List <int> selected_mems = MyStrings.Get_Array_Intiger(kStr);

            for (int i = 0; i < DGV_Joints.RowCount; i++)
            {
                jc = new JointCoordinate();

                jc.NodeNo = MyStrings.StringToInt(DGV_Joints[0, i].Value.ToString(), 0);
                jc.X      = MyStrings.StringToDouble(DGV_Joints[1, i].Value.ToString(), 0.0);
                jc.Y      = MyStrings.StringToDouble(DGV_Joints[2, i].Value.ToString(), 0.0);
                jc.Z      = MyStrings.StringToDouble(DGV_Joints[3, i].Value.ToString(), 0.0);
                jcc.Add(jc);
            }

            for (int i = 0; i < DGV_Members.RowCount; i++)
            {
                mi = new MemberIncidence();

                mi.MemberNo = MyStrings.StringToInt(DGV_Members[0, i].Value.ToString(), 0);
                //jc.X = MyStrings.StringToDouble(DGV_Members[1, i].Value.ToString(), 0.0);
                mi.StartNode.NodeNo = MyStrings.StringToInt(DGV_Members[2, i].Value.ToString(), 0);
                mi.EndNode.NodeNo   = MyStrings.StringToInt(DGV_Members[3, i].Value.ToString(), 0);
                mic.Add(mi);
            }

            mic.CopyJointCoordinates(jcc);
            foreach (var item in mic)
            {
                if (item.StartNode.Y == item.EndNode.Y)
                {
                    if (selected_mems.Contains(item.MemberNo))
                    {
                        selected_beams.Add(item.MemberNo);
                    }

                    d = item.StartNode.Y;
                    if (!flvls.Contains(d))
                    {
                        flvls.Add(d);
                        //cmb_floor_levels.Items.Add(d.ToString("f3"));
                    }
                }
                else if (item.StartNode.X == item.EndNode.X &&
                         item.StartNode.Z == item.EndNode.Z)
                {
                    if (selected_mems.Contains(item.MemberNo))
                    {
                        selected_columns.Add(item.MemberNo);
                    }

                    AllColumn.Add(item.MemberNo);
                }
            }


            flvls.Sort();
            List <int> mems      = new List <int>();
            List <int> all_beams = new List <int>();

            foreach (var lvl in flvls)
            {
                cmb_floor_levels.Items.Add(lvl.ToString("f3"));
                mems = new List <int>();
                foreach (var item in mic)
                {
                    if (item.StartNode.Y == item.EndNode.Y)
                    {
                        d = item.StartNode.Y;
                        if (lvl == d)
                        {
                            mems.Add(item.MemberNo);
                        }
                    }
                }
                BeamTable.Add(lvl.ToString("f3"), mems);

                all_beams.AddRange(mems.ToArray());
            }
            BeamTable.Add("all", all_beams);
        }
Ejemplo n.º 12
0
        public void RunThread()
        {
            List <string> list = new List <string>();

            #region TechSOFT Banner
            list.Add("");

            //list.Add("");
            //list.Add("\t\t**********************************************");
            //list.Add("\t\t*          ASTRA Pro Release 18.0            *");
            //list.Add("\t\t*      TechSOFT Engineering Services         *");
            //list.Add("\t\t*                                            *");
            //list.Add("\t\t*           DESIGN OF RCC COLUMN             *");
            //list.Add("\t\t*                                            *");
            //list.Add("\t\t**********************************************");
            //list.Add("\t\t----------------------------------------------");
            //list.Add("\t\tTHIS RESULT CREATED ON " + System.DateTime.Now.ToString("dd.MM.yyyy  AT HH:mm:ss") + " ");
            //list.Add("\t\t----------------------------------------------");
            //list.Add("");

            #endregion



            int c    = 0;
            int step = 1;


            string ColumnNos = "";

            bool flag = false;
            //int c = 0;
            for (int i = 0; i < dgv_columns.RowCount; i++)
            {
                try
                {
                    c    = 0;
                    flag = (bool)dgv_columns[c++, i].Value;

                    if (flag)
                    {
                        Set_Grid_Color(i);

                        ////cd.ColumnNos = dgv_columns[c++, i].Value.ToString();
                        //if (MessageBox.Show("Process Design Column " + cd.ColumnNos + " \n\nDou you want to continue ?",
                        //    "ASTRA", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                        //{
                        //    break;
                        //}
                        //col_design.hf = (Floors[i + 1] - Floors[i]) * 1000;
                        col_design.floor_level = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0.0);
                        col_design.FlightNos   = MyStrings.StringToInt(dgv_columns[c++, i].Value.ToString(), 0);
                        col_design.hf          = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0);
                        col_design.wf          = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0);
                        col_design.wl          = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0);
                        col_design.tw          = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0);
                        col_design.bar_dia1    = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0);
                        col_design.bar_dia2    = MyStrings.StringToDouble(dgv_columns[c++, i].Value.ToString(), 0);


                        list.AddRange(col_design.Design_Program_Loop(i + 1).ToArray());
                        Set_Grid_Color(i, true, col_design.IS_DESIGN_OK);

                        dgv_columns[9, i].Value = col_design.IS_DESIGN_OK ? " OK " : "NOT OK";

                        Add_Staircase_BOQ(col_design.BOQ);
                    }
                }
                catch (Exception exx) { }
            }



            #region End of Report
            list.Add("");
            list.Add("---------------------------------------------------------------------------");
            list.Add("---------------------       END OF REPORT        --------------------------");
            list.Add("---------------------------------------------------------------------------");
            #endregion End of Report

            Save_Data();

            File.WriteAllLines(col_design.Report_File, list.ToArray());

            MessageBox.Show(this, "Report file created in file " + col_design.Report_File);

            frmASTRAReport fap = new frmASTRAReport(col_design.Report_File);
            fap.Owner = this;
            fap.ShowDialog();
        }
Ejemplo n.º 13
0
        public void Draw_Members()
        {
            //Clear_All();
            ASTRADoc astdoc;

            //astdoc = new ASTRADoc(ACad.AstraDocument);
            astdoc = (iACad.AstraDocument);


            astdoc.Members.Clear();

            for (int i = 0; i < DGV.Rows.Count; i++)
            {
                MemberIncidence mbr = new MemberIncidence();

                DGV[0, i].Value = i + 1;

                mbr.MemberNo = MyStrings.StringToInt(DGV[0, i].Value.ToString(), 0);

                if (DGV[1, i].Value.ToString().StartsWith("C"))
                {
                    mbr.MemberType = MembType.CABLE;
                }
                else if (DGV[1, i].Value.ToString().StartsWith("T"))
                {
                    mbr.MemberType = MembType.TRUSS;
                }
                else
                {
                    mbr.MemberType = MembType.BEAM;
                }

                mbr.StartNode.NodeNo = MyStrings.StringToInt(DGV[2, i].Value.ToString(), 0);



                mbr.EndNode.NodeNo = MyStrings.StringToInt(DGV[3, i].Value.ToString(), 0);


                astdoc.Members.Add(mbr);
            }


            foreach (var item in iACad.Document.ActionLayout.Entities)
            {
                if (item is vdFigure)
                {
                    vdFigure vf = item as vdFigure;
                    if (vf.Layer.Name == "Members")
                    {
                        vf.Deleted = true;
                    }
                }
            }


            iACad.Document.Redraw(true);

            astdoc.Members.CopyJointCoordinates(astdoc.Joints);

            astdoc.MemberProperties.CopyMemberIncidence(astdoc.Members);

            astdoc.Members.DrawMember(iACad.Document, 0.3);
        }
Ejemplo n.º 14
0
        private void btn_mbr_add_Click(object sender, EventArgs e)
        {
            string kStr = "";

            if (DGV != null)
            {
                if (btn_add_mem.Text == "Change")
                {
                    if (ASTRA_Data.Count > 0)
                    {
                        kStr = ASTRA_Data[0];
                        int r = MyStrings.StringToInt(kStr, 0);

                        DGV[0, r].Value = StartMemberNo;
                        DGV[1, r].Value = cmb_memtype.Text;
                        DGV[2, r].Value = StartMemberJointNo.ToString("f0");
                        DGV[3, r].Value = EndMemberJointNo.ToString("f0");
                        Draw_Members();
                    }

                    this.Close();
                }
                else if (btn_add_mem.Text == "Insert")
                {
                    if (ASTRA_Data.Count > 0)
                    {
                        kStr = ASTRA_Data[0];
                        int r = DGV.CurrentCell.RowIndex;


                        if (DGV.SelectedCells.Count > 0)
                        {
                            r = DGV.SelectedCells[0].RowIndex;
                        }


                        DGV.Rows.Insert(r, StartMemberNo,
                                        cmb_memtype.Text,
                                        StartMemberJointNo.ToString("f0"),
                                        EndMemberJointNo.ToString("f0"));

                        StartMemberNo      = StartMemberNo + StartIncrNo;
                        StartMemberJointNo = StartMemberJointNo + StartIncrJointNo;
                        EndMemberJointNo   = EndMemberJointNo + EndIncrJointNo;

                        Draw_Members();
                    }
                }
                else
                {
                    DGV.Rows.Add(StartMemberNo,
                                 cmb_memtype.Text,
                                 StartMemberJointNo.ToString("f0"),
                                 EndMemberJointNo.ToString("f0"));

                    StartMemberNo      = StartMemberNo + StartIncrNo;
                    StartMemberJointNo = StartMemberJointNo + StartIncrJointNo;
                    EndMemberJointNo   = EndMemberJointNo + EndIncrJointNo;
                    Draw_Members();
                }
            }
            else
            {
                this.Close();
            }
        }
Ejemplo n.º 15
0
        private void frmMembers_Load(object sender, EventArgs e)
        {
            cmb_memtype.SelectedIndex = 0;

            if (ASTRA_Data.Count > 0)
            {
                string kStr = ASTRA_Data[0];

                if (kStr == "INSERT")
                {
                    int r = DGV.CurrentCell.RowIndex;

                    txt_mbr_start_no.Text = DGV[0, r].Value.ToString();

                    if (DGV[1, r].Value.ToString().StartsWith("C"))
                    {
                        cmb_memtype.SelectedIndex = 2;
                    }
                    else if (DGV[1, r].Value.ToString().StartsWith("T"))
                    {
                        cmb_memtype.SelectedIndex = 1;
                    }
                    else
                    {
                        cmb_memtype.SelectedIndex = 0;
                    }

                    txt_mbr_start_jnt.Text = DGV[2, r].Value.ToString();
                    txt_mbr_end_jnt.Text   = DGV[3, r].Value.ToString();

                    btn_add_mem.Text = "Insert";
                }
                else
                {
                    MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' ');

                    int r = MyStrings.StringToInt(kStr, 0);

                    txt_mbr_start_no.Text = DGV[0, r].Value.ToString();
                    if (DGV[1, r].Value.ToString().StartsWith("C"))
                    {
                        cmb_memtype.SelectedIndex = 2;
                    }
                    else if (DGV[1, r].Value.ToString().StartsWith("T"))
                    {
                        cmb_memtype.SelectedIndex = 1;
                    }
                    else
                    {
                        cmb_memtype.SelectedIndex = 0;
                    }

                    txt_mbr_start_jnt.Text = DGV[2, r].Value.ToString();
                    txt_mbr_end_jnt.Text   = DGV[3, r].Value.ToString();

                    btn_add_mem.Text = "Change";
                }
            }
            else
            {
                txt_mbr_start_no.Text = (DGV.RowCount + 1) + "";
                if (DGV.RowCount == 0)
                {
                    txt_mbr_start_jnt.Text  = "1";
                    txt_mbr_end_jnt.Text    = "2";
                    txt_incr_start_no.Text  = "1";
                    txt_incr_start_jnt.Text = "1";
                    txt_incr_end_jnt.Text   = "1";
                }
            }
        }
Ejemplo n.º 16
0
        private void btn_elmt_add_Click(object sender, EventArgs e)
        {
            string kStr = "";



            if (DGV != null)
            {
                if (btn_elmt_add.Text == "Change")
                {
                    if (ASTRA_Data.Count > 0)
                    {
                        kStr = ASTRA_Data[0];
                    }

                    int r = MyStrings.StringToInt(kStr, 0);

                    DGV[0, r].Value = ElementNo;
                    DGV[1, r].Value = Node1.ToString();
                    DGV[2, r].Value = Node2.ToString();
                    DGV[3, r].Value = Node3.ToString();
                    DGV[4, r].Value = Node4.ToString();

                    Draw_Elements();
                    this.Close();
                }
                else if (btn_elmt_add.Text == "Insert")
                {
                    int r = DGV.CurrentCell.RowIndex;

                    if (DGV.SelectedCells.Count > 0)
                    {
                        r = DGV.SelectedCells[0].RowIndex;
                    }

                    DGV.Rows.Insert(r, ElementNo,
                                    Node1,
                                    Node2,
                                    Node3,
                                    Node4);

                    ElementNo = ElementNo + 1;

                    Draw_Elements();
                }
                else
                {
                    DGV.Rows.Add(ElementNo,
                                 Node1,
                                 Node2,
                                 Node3,
                                 Node4);

                    ElementNo = ElementNo + 1;

                    Draw_Elements();
                }
            }
            else
            {
                this.Close();
            }
        }
Ejemplo n.º 17
0
        private void btn_jnt_add_Click(object sender, EventArgs e)
        {
            string kStr = "";



            if (DGV != null)
            {
                if (btn_jnt_add.Text == "Change")
                {
                    if (ASTRA_Data.Count > 0)
                    {
                        kStr = ASTRA_Data[0];
                    }

                    int r = MyStrings.StringToInt(kStr, 0);

                    DGV[0, r].Value = StartJointNo;
                    DGV[1, r].Value = StartJoint_X.ToString("f4");
                    DGV[2, r].Value = StartJoint_Y.ToString("f4");
                    DGV[3, r].Value = StartJoint_Z.ToString("f4");

                    Draw_Joints();
                    this.Close();
                }
                else if (btn_jnt_add.Text == "Insert")
                {
                    int r = DGV.CurrentCell.RowIndex;


                    if (DGV.SelectedCells.Count > 0)
                    {
                        r = DGV.SelectedCells[0].RowIndex;
                    }

                    DGV.Rows.Insert(r, StartJointNo,
                                    StartJoint_X.ToString("f4"),
                                    StartJoint_Y.ToString("f4"),
                                    StartJoint_Z.ToString("f4"));

                    StartJointNo = StartJointNo + EndJointNo;
                    StartJoint_X = StartJoint_X + EndJoint_X;
                    StartJoint_Y = StartJoint_Y + EndJoint_Y;
                    StartJoint_Z = StartJoint_Z + EndJoint_Z;
                    Draw_Joints();
                }
                else
                {
                    DGV.Rows.Add(StartJointNo,
                                 StartJoint_X.ToString("f4"),
                                 StartJoint_Y.ToString("f4"),
                                 StartJoint_Z.ToString("f4"));

                    StartJointNo = StartJointNo + EndJointNo;
                    StartJoint_X = StartJoint_X + EndJoint_X;
                    StartJoint_Y = StartJoint_Y + EndJoint_Y;
                    StartJoint_Z = StartJoint_Z + EndJoint_Z;
                    Draw_Joints();
                }
            }
            else
            {
                this.Close();
            }
        }