private void cmb_flr_lvl_SelectedIndexChanged(object sender, EventArgs e) { VDoc.ActiveLayOut.Entities.RemoveAll(); VDoc.Redraw(true); panel1.Visible = false; txt_beam_nos.Text = ""; }
void BaseControl_MouseMove(object sender, MouseEventArgs e) { gPoint ccspt = VDoc.CCS_CursorPos(); double x = ccspt.x; double y = ccspt.y; double z = ccspt.z; tsb_coordinate.Text = string.Format("{0:f4}, {1:f4}, {2:f4}", x, y, z); }
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); }
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); }
private void toolStripButtons_Click(object sender, EventArgs e) { vdDocument VD = VDoc; bool f = false; VDoc.Prompt("command:"); ToolStripButton tsb = sender as ToolStripButton; if (tsb.Name == tsb_3D_rotate.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_Vrot(VD); } else if (tsb.Name == tsb_VTop.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VTop(VD); } else if (tsb.Name == tsb_VBot.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VBottom(VD); } else if (tsb.Name == tsb_VLeft.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VLeft(VD); } else if (tsb.Name == tsb_VRight.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VRight(VD); } else if (tsb.Name == tsb_VFront.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VFront(VD); } else if (tsb.Name == tsb_VBack.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VBack(VD); } else if (tsb.Name == tsb_VNE.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VINE(VD); } else if (tsb.Name == tsb_VNW.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VINW(VD); } else if (tsb.Name == tsb_VSE.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VISE(VD); } else if (tsb.Name == tsb_VSW.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VISW(VD); } else if (tsb.Name == tsb_ZoomA.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.ZoomA_Ex(VD); } else if (tsb.Name == tsb_ZoomE.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.ZoomE_Ex(VD); } else if (tsb.Name == tsb_ZoomP.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.ZoomP_Ex(VD); } else if (tsb.Name == tsb_ZoomW.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.ZoomW_Ex(VD); } else if (tsb.Name == tsb_ZoomIn.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.ZoomIn_Ex(VD); } else if (tsb.Name == tsb_ZoomOut.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.ZoomOut_Ex(VD); } else if (tsb.Name == tsb_Pan.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.PanEx(VD); } else if (tsb.Name == tsb_ShadeOn.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_ShadeOn(VD); } else if (tsb.Name == tsb_Wire.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_Wire2d(VD); } else if (tsb.Name == tsb_Dist.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.GetDistanceEx(VD); } else if (tsb.Name == tsb_Layers.Name) { VectorDraw.Professional.Dialogs.LayersDialog.Show(VD); } //VectorDraw.Professional.ActionUtilities.vdCommandAction.Layer(VD); else if (tsb.Name == tsb_Rotate.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.RotateEx(VD); } else if (tsb.Name == tsb_Undo.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.UndoEx(VD); } else if (tsb.Name == tsb_Redo.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.RedoEx(VD); } else if (tsb.Name == tsb_copy.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.CopyEx(VD); } else if (tsb.Name == tsb_Erase.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.EraseEx(VD); } else if (tsb.Name == tsb_Move.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.MoveEx(VD); } else if (tsb.Name == tsb_Explode.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.ExplodeEx(VD); } else if (tsb.Name == tsb_Mirror.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.MirrorEx(VD); } else if (tsb.Name == tsb_Scale.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.ScaleEx(VD); } else if (tsb.Name == tsb_Break.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.BreakEx(VD); } else if (tsb.Name == tsb_Trim.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.TrimEx(VD); } else if (tsb.Name == tsb_Extend.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.ExtendEx(VD); } else if (tsb.Name == tsb_Insert.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.InsertEx(VD); } else if (tsb.Name == tsb_Regen.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.RegenEx(VD); } else if (tsb.Name.EndsWith("OsnapEnd")) { VD.osnapMode = OsnapMode.END; } else if (tsb.Name.EndsWith("OsnapCen")) { VD.osnapMode = OsnapMode.CEN; } else if (tsb.Name.EndsWith("OsnapIns")) { VD.osnapMode = OsnapMode.INS; } else if (tsb.Name.EndsWith("OsnapMid")) { VD.osnapMode = OsnapMode.MID; } else if (tsb.Name.EndsWith("OsnapPer")) { VD.osnapMode = OsnapMode.PER; } else if (tsb.Name.EndsWith("OsnapNea")) { VD.osnapMode = OsnapMode.NEA; } else if (tsb.Name.EndsWith("OsnapInters")) { VD.osnapMode = OsnapMode.INTERS; } else if (tsb.Name.EndsWith("OsnapNode")) { VD.osnapMode = OsnapMode.NODE; } else if (tsb.Name.EndsWith("OsnapTang")) { VD.osnapMode = OsnapMode.TANG; } else if (tsb.Name.EndsWith("OsnapApparentInt")) { VD.osnapMode = OsnapMode.APPARENTINT; } else if (tsb.Name.EndsWith("OsnapNone")) { VD.osnapMode = OsnapMode.NONE; } else if (tsb.Name.EndsWith("OsnapCancel")) { VD.osnapMode = OsnapMode.DISABLE; } else if (tsb.Name == tsb_Line.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.LineEx(VD); } else if (tsb.Name == tsb_Polyline.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.PolylineEx(VD); } else if (tsb.Name == tsb_Circle.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.CircleEx(VD); } else if (tsb.Name == tsb_arc.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.ArcEx(VD); } else if (tsb.Name == tsb_Rect.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.RectEx(VD); } else if (tsb.Name == tsb_Text.Name) { VectorDraw.Professional.ActionUtilities.vdCommandAction.TextEx(VD); } else if (tsb.Name == tsb_Ortho.Name) { VD.OrthoMode = tsb_Ortho.Checked; } //VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_Wire(VD); else if (tsb.Name == tsb_Save.Name) { using (SaveFileDialog sfd = new SaveFileDialog()) { sfd.Filter = "VDML File (*.vdml)|*.vdml|DXF File (*.dxf)|*.dxf|DWG File (*.dwg)|*.dwg"; if (File.Exists(VD.FileName)) { sfd.InitialDirectory = Path.GetDirectoryName(VD.FileName); sfd.FileName = Path.GetFileNameWithoutExtension(VD.FileName); //sfd.DefaultExt = Path.GetExtension(VD.FileName); } if (sfd.ShowDialog() != DialogResult.Cancel) { if (iApp.IsDemo) { MessageBox.Show("This function is not available in Demo version.", "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (VD.SaveAs(sfd.FileName)) { MessageBox.Show("File Saved successfully.", "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } } } else if (tsb.Name == tsb_Open.Name) { using (OpenFileDialog sfd = new OpenFileDialog()) { sfd.Filter = "VDML File (*.vdml)|*.vdml|DXF File (*.dxf)|*.dxf|DWG File (*.dwg)|*.dwg"; if (sfd.ShowDialog() != DialogResult.Cancel) { //if (iApp.IsDemo) //{ // MessageBox.Show("This function is not available in Demo version.", "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information); //} //else { if (VD.Open(sfd.FileName)) { if (Open_Drawing != null) { Open_Drawing(sender, e); } MessageBox.Show("File Opened successfully.", "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } } } }
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(); }
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); }