Example #1
0
        public frmSteelBeamBoQ(IApplication iapp, ASTRADoc ast_doc, StructureMemberAnalysis staAna)
        {
            InitializeComponent();
            iApp = iapp;

            StructureAnalysis = staAna;
            AST_DOC           = ast_doc;
            d1 = 16;
            d2 = 25;
            d3 = 16;
            d4 = 25;
            //d5 = 20;
            //d6 = 25;
            //Stirrup_Bar_Dia = 8;

            uC_SteelSections1.SetIApplication(iApp);
        }
Example #2
0
 public frmMovingForces(vdDocument vDoc, string file_name, int selected_load_case)
 {
     InitializeComponent();
     doc       = vDoc;
     load_case = selected_load_case;
     try
     {
         file_name = Path.Combine(Path.GetDirectoryName(file_name), "ANALYSIS_REP.TXT");
         //if (AnalysisResult == null)
         //    AnalysisResult = new SteelTrussMemberAnalysis(file_name);
         //else
         //{
         //    if (AnalysisResult.Analysis_File != file_name)
         //        AnalysisResult = new SteelTrussMemberAnalysis(file_name);
         //}
         AnalysisResult = new StructureMemberAnalysis(file_name);
     }
     catch (Exception ex) { AnalysisResult = null; }
 }
Example #3
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();
        }
Example #4
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;
        }
Example #5
0
        private void Get_Reactions()
        {
            if (Str_Analysis == null)
            {
                Str_Analysis = new StructureMemberAnalysis(iACad.AstraDocument.AnalysisFileName);
            }

            //txt_smcs_jnts_1.Text = "8,24,40,56";
            //txt_smcs_jnts_2.Text = "72,88,104,120";

            string jnts1 = txt_sup_ract_jnts_1.Text.Replace(",", " ");
            MyList jnts  = new MyList(jnts1, ' ');


            double vl   = Str_Analysis.GetMaxReaction(1);
            string kStr = "";


            if (jnts.Count > 1)
            {
                vl   = Str_Analysis.GetMaxReaction(jnts.GetInt(0));
                kStr = vl.ToString();

                for (int i = 1; i < jnts.Count; i++)
                {
                    vl   = Str_Analysis.GetMaxReaction(jnts.GetInt(i));
                    kStr = kStr + "," + vl.ToString();
                }
            }
            txt_sup_ract_1.Text = kStr;


            //kStr = vl.ToString();

            //vl = Str_Analysis.GetMaxReaction(17);

            //kStr = kStr + "," + vl.ToString();

            //vl = Str_Analysis.GetMaxReaction(33);

            //kStr = kStr + "," + vl.ToString();

            //vl = Str_Analysis.GetMaxReaction(49);

            //kStr = kStr + "," + vl.ToString();

            //txt_sup_ract_1.Text = kStr;


            kStr = "";


            jnts1 = txt_sup_ract_jnts_2.Text.Replace(",", " ");
            jnts  = new MyList(jnts1, ' ');


            if (jnts.Count > 1)
            {
                vl   = Str_Analysis.GetMaxReaction(jnts.GetInt(0));
                kStr = vl.ToString();

                for (int i = 1; i < jnts.Count; i++)
                {
                    vl   = Str_Analysis.GetMaxReaction(jnts.GetInt(i));
                    kStr = kStr + "," + vl.ToString();
                }
            }


            //vl = Str_Analysis.GetMaxReaction(65);

            //kStr = vl.ToString();


            //vl = Str_Analysis.GetMaxReaction(81);

            //kStr = kStr + "," + vl.ToString();

            //vl = Str_Analysis.GetMaxReaction(97);

            //kStr = kStr + "," + vl.ToString();


            //vl = Str_Analysis.GetMaxReaction(113);

            //kStr = kStr + "," + vl.ToString();
            txt_sup_ract_2.Text = kStr;



            Calculate_Forces();
        }