public Axial(vdDocument vdoc) { //X = Y = Z = 0.0; vDoc = vdoc; Wheel1 = new vdCircle(); Wheel1.SetUnRegisterDocument(vdoc); Wheel1.setDocumentDefaults(); Wheel1.Radius = WheelRadius; vdoc.ActiveLayOut.Entities.AddItem(Wheel1); Wheel2 = new vdCircle(); Wheel2.SetUnRegisterDocument(vdoc); Wheel2.setDocumentDefaults(); Wheel2.Radius = WheelRadius; vdoc.ActiveLayOut.Entities.AddItem(Wheel2); Axis = new vdLine(); Axis.SetUnRegisterDocument(vdoc); Axis.setDocumentDefaults(); Axis.StartPoint = Wheel1.Center; Axis.EndPoint = Wheel2.Center; vdoc.ActiveLayOut.Entities.AddItem(Axis); WheelRadius = (Width == 0.0) ? 0.2d : Width / 10.0; }
private vdPolyface CreatePolyFaceFromCurve(vdPolyline curvePath, double diameter) { var pf = new vdPolyface(); pf.SetUnRegisterDocument(vDraw.ActiveDocument); pf.setDocumentDefaults(); var circle = new vdCircle { Radius = diameter / 2.0 }; vdCurve path = curvePath; if (curvePath.VertexList.Count == 2) { var line = new vdLine(); line.SetUnRegisterDocument(vDraw.ActiveDocument); line.setDocumentDefaults(); line.StartPoint = curvePath.getStartPoint(); line.EndPoint = curvePath.getEndPoint(); path = line; } pf.Generate3dPathSection(path, circle, new gPoint(0, 0, 0), 6, 1); pf.SmoothAngle = 45; pf.PenColor.ColorIndex = 2; vDraw.ActiveDocument.ActiveLayOut.Entities.Add(pf); return(pf); }
public PlanWheel(vdDocument vdoc) { //X = Y = Z = 0.0; WheelRadius = 0.3d; vDoc = vdoc; Wheel1 = new vdCircle(); Wheel1.SetUnRegisterDocument(vdoc); Wheel1.setDocumentDefaults(); Wheel1.Radius = WheelRadius; Wheel1.ExtrusionVector = new Vector(0, 1, 0); vdoc.ActiveLayOut.Entities.AddItem(Wheel1); Wheel2 = new vdCircle(); Wheel2.SetUnRegisterDocument(vdoc); Wheel2.setDocumentDefaults(); Wheel2.Radius = WheelRadius; Wheel2.ExtrusionVector = new Vector(0, 1, 0); vdoc.ActiveLayOut.Entities.AddItem(Wheel2); Axis = new vdLine(); Axis.SetUnRegisterDocument(vdoc); Axis.setDocumentDefaults(); Axis.StartPoint = Wheel1.Center; Axis.EndPoint = Wheel2.Center; vdoc.ActiveLayOut.Entities.AddItem(Axis); }
public void DrawMember(MemberIncidence mi, vdDocument doc, double txtSize) { double length, factor; doc.Palette.Background = Color.White; vdLine line = new vdLine(); vdText vtxtMemberNo = new vdText(); line.SetUnRegisterDocument(doc); line.setDocumentDefaults(); vtxtMemberNo.SetUnRegisterDocument(doc); vtxtMemberNo.setDocumentDefaults(); line.PenColor = new vdColor(Color.Black); line.Layer = doc.Layers[0]; doc.Layers[0].Frozen = false; line.StartPoint = mi.StartNode.Point; line.EndPoint = mi.EndNode.Point; line.ToolTip = string.Format("Member No : {0} [Nodes ({1}, {2})]", mi.MemberNo, mi.StartNode.NodeNo, mi.EndNode.NodeNo); doc.ActionLayout.Entities.AddItem(line); length = line.Length(); //factor = 22.2222d; //factor = length / 0.9d; //txtSize = length / factor; //txtSize = GetTextSize(); vtxtMemberNo.TextString = mi.MemberNo.ToString(); vtxtMemberNo.Layer = membersLay; vtxtMemberNo.Height = txtSize; vtxtMemberNo.PenColor = new vdColor(Color.Blue); vtxtMemberNo.InsertionPoint = (mi.StartNode.Point + mi.EndNode.Point) / 2; vtxtMemberNo.Layer = membersLay; vtxtMemberNo.ToolTip = string.Format("Member No : {0} [Nodes ({1}, {2})]", mi.MemberNo, mi.StartNode.NodeNo, mi.EndNode.NodeNo); doc.ActionLayout.Entities.AddItem(vtxtMemberNo); //doc.ZoomAll(); //doc.Redraw(true); }
public frmMemberLoadCase(vdDocument thisDoc, vdDocument memberDoc, vdDocument memberLoadDoc, vdDocument memberJointLoad, ASTRADoc thisAstDoc, Form thisForm, Form memberForm, Form memberLoadForm, Form memberJointLoadForm) { InitializeComponent(); Maindoc = thisDoc; MemberDoc = memberDoc; MemberLoadDoc = memberLoadDoc; MemberJointLoadDoc = memberJointLoad; astDoc = thisAstDoc; SetMember(); memberLine = new vdLine(); cirMember = new vdCircle(); cirMember.SetUnRegisterDocument(Maindoc); cirMember.setDocumentDefaults(); memberLine.SetUnRegisterDocument(Maindoc); memberLine.setDocumentDefaults(); Maindoc.ActiveLayOut.Entities.AddItem(memberLine); Maindoc.ActiveLayOut.Entities.AddItem(cirMember); formText = thisForm.Text; frmMain = thisForm; frmMember = memberForm; frmMemberLoad = memberLoadForm; frmMemberJointLoad = memberJointLoadForm; }
public Axial(vdDocument vdoc, string loads) { //X = Y = Z = 0.0; vDoc = vdoc; Wheel1 = new vdCircle(); Wheel1.SetUnRegisterDocument(vdoc); Wheel1.setDocumentDefaults(); Wheel1.Radius = WheelRadius; vdoc.ActiveLayOut.Entities.AddItem(Wheel1); Wheel2 = new vdCircle(); Wheel2.SetUnRegisterDocument(vdoc); Wheel2.setDocumentDefaults(); Wheel2.Radius = WheelRadius; vdoc.ActiveLayOut.Entities.AddItem(Wheel2); Axis = new vdLine(); Axis.SetUnRegisterDocument(vdoc); Axis.setDocumentDefaults(); Axis.StartPoint = Wheel1.Center; Axis.EndPoint = Wheel2.Center; vdoc.ActiveLayOut.Entities.AddItem(Axis); WheelRadius = 0.3d; Load = (new MyList(loads, ' ')).StringList[0]; }
public ActionDisNetCommands(gPoint startPoint, vdLayout layout, gPoint endPoint) : base(startPoint, layout) { ValueTypeProp |= valueType.DISTANCE; figure = new vdLine(); figure.SetUnRegisterDocument(layout.Document); figure.setDocumentDefaults(); figure.StartPoint = startPoint; figure.EndPoint = startPoint; figure.ExtrusionVector = Vector.CreateExtrusion(startPoint, endPoint); figure.Thickness = startPoint.Distance3D(endPoint); }
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); }
public frmMemberLoadCase(vdDocument thisDoc, ASTRADoc thisAstDoc) { InitializeComponent(); Maindoc = thisDoc; astDoc = thisAstDoc; SetMember(); memberLine = new vdLine(); cirMember = new vdCircle(); cirMember.SetUnRegisterDocument(Maindoc); cirMember.setDocumentDefaults(); memberLine.SetUnRegisterDocument(Maindoc); memberLine.setDocumentDefaults(); Maindoc.ActiveLayOut.Entities.AddItem(memberLine); Maindoc.ActiveLayOut.Entities.AddItem(cirMember); }
private void button1_Click(object sender, EventArgs e) { ln1 = new vdLine(); ln1 = new vdLine(); ln1.SetUnRegisterDocument(doc); ln1.setDocumentDefaults(); doc.ActiveLayOut.Entities.AddItem(ln1); ln1.StartPoint = new gPoint(10d, y, 0d); ln1.EndPoint = new gPoint(14d, y, 0d); y += 2.0d; ln2 = new vdLine(); ln2 = new vdLine(); ln2.SetUnRegisterDocument(doc); ln2.setDocumentDefaults(); doc.ActiveLayOut.Entities.AddItem(ln2); ln2.StartPoint = new gPoint(10d, y, 0d); ln2.EndPoint = new gPoint(14d, y, 0d); y += 2.0d; ln3 = new vdLine(); ln3 = new vdLine(); ln3.SetUnRegisterDocument(doc); ln3.setDocumentDefaults(); doc.ActiveLayOut.Entities.AddItem(ln3); ln3.StartPoint = new gPoint(10d, y, 0d); ln3.EndPoint = new gPoint(14d, y, 0d); y += 2.0d; doc.Redraw(true); }
public static bool ReadLineCoordinates(string fileName, vdDocument doc) { //vdArray<vdLine> line_arr = new vdArray<vdLine>(); List <string> lstStr = new List <string>(File.ReadAllLines(fileName)); string kStr = ""; string option = ""; string SP, EP, TEXT, IP, Height; SP = EP = IP = TEXT = Height = ""; MyStrings mList = null; for (int i = 0; i < lstStr.Count; i++) { kStr = lstStr[i].Trim().TrimEnd().TrimStart(); if (kStr == "VD_LINE") { option = "VD_LINE"; i++; SP = lstStr[i].Replace("SP=", ""); i++; EP = lstStr[i].Replace("EP=", ""); } else if (kStr == "VD_TEXT") { option = "VD_TEXT"; i++; IP = lstStr[i].Replace("IP=", ""); i++; TEXT = lstStr[i].Replace("TEXT=", ""); i++; Height = lstStr[i].Replace("HEIGHT=", ""); } switch (option) { case "VD_LINE": mList = new MyStrings(MyStrings.RemoveAllSpaces(SP), ','); vdLine ln = new vdLine(); ln.SetUnRegisterDocument(doc); ln.setDocumentDefaults(); ln.StartPoint.x = mList.GetDouble(0); ln.StartPoint.y = mList.GetDouble(1); ln.StartPoint.z = mList.GetDouble(2); mList = new MyStrings(MyStrings.RemoveAllSpaces(EP), ','); ln.EndPoint.x = mList.GetDouble(0); ln.EndPoint.y = mList.GetDouble(1); ln.EndPoint.z = mList.GetDouble(2); doc.ActiveLayOut.Entities.AddItem(ln); break; case "VD_TEXT": mList = new MyStrings(MyStrings.RemoveAllSpaces(IP), ','); vdText txt = new vdText(); txt.SetUnRegisterDocument(doc); txt.setDocumentDefaults(); txt.InsertionPoint.x = mList.GetDouble(0); txt.InsertionPoint.y = mList.GetDouble(1); txt.InsertionPoint.z = mList.GetDouble(2); txt.TextString = TEXT; txt.Height = MyStrings.StringToDouble(Height, 0.01); doc.ActiveLayOut.Entities.AddItem(txt); break; } } lstStr.Clear(); //doc.ShowUCSAxis = false; //VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VTop(doc); //doc.Redraw(true); return(true); }
public void DrawMember(MemberIncidence mi, vdDocument doc) { double length, factor, txtSize; doc.Palette.Background = Color.White; vdLine line = new vdLine(); vdText vtxtStartNode = new vdText(); vdText vtxtEndNode = new vdText(); vdText vtxtMemberNo = new vdText(); line.SetUnRegisterDocument(doc); line.setDocumentDefaults(); vtxtStartNode.SetUnRegisterDocument(doc); vtxtStartNode.setDocumentDefaults(); vtxtEndNode.SetUnRegisterDocument(doc); vtxtEndNode.setDocumentDefaults(); vtxtMemberNo.SetUnRegisterDocument(doc); vtxtMemberNo.setDocumentDefaults(); line.PenColor = new vdColor(Color.Black); line.StartPoint = mi.StartNode.Point; line.EndPoint = mi.EndNode.Point; //line.ToolTip = string.Format("Member No : {0} \nStart Node = {1} [X={2}, Y={3}, Z={4}]\nEnd Node = {5} [X={6}, Y={7}, Z={8}]", // mi.MemberNo, // mi.StartNode.NodeNo, // mi.StartNode.Point.x, // mi.StartNode.Point.y, // mi.StartNode.Point.z, // mi.EndNode.NodeNo, // mi.EndNode.Point.x, // mi.EndNode.Point.y, // mi.EndNode.Point.z); line.ToolTip = string.Format("Member No : {0} [Nodes ({1}, {2})]", mi.MemberNo, mi.StartNode.NodeNo, mi.EndNode.NodeNo); doc.ActionLayout.Entities.AddItem(line); // Chiranjit Modified [2010 04 16], Kolkata, TechSOFT object jc_no = hash_joint_no[mi.StartNode.NodeNo]; if (jc_no == null) { hash_joint_no.Add(mi.StartNode.NodeNo, mi.StartNode.NodeNo); vtxtEndNode.ToolTip = string.Format("Node No : {0} [X={1}, Y={2}, Z={3}]", mi.StartNode.NodeNo, mi.StartNode.Point.x, mi.StartNode.Point.y, mi.StartNode.Point.z); doc.ActionLayout.Entities.AddItem(vtxtStartNode); } jc_no = hash_joint_no[mi.EndNode.NodeNo]; if (jc_no == null) { hash_joint_no.Add(mi.EndNode.NodeNo, mi.EndNode.NodeNo); vtxtEndNode.ToolTip = string.Format("Node No : {0} [X={1}, Y={2}, Z={3}]", mi.EndNode.NodeNo, mi.EndNode.Point.x, mi.EndNode.Point.y, mi.EndNode.Point.z); doc.ActionLayout.Entities.AddItem(vtxtEndNode); } //doc.ActionLayout.Entities.AddItem(vtxtStartNode); //doc.ActionLayout.Entities.AddItem(vtxtEndNode); doc.ActionLayout.Entities.AddItem(vtxtMemberNo); length = line.Length(); //factor = 22.2222d; //factor = length / 0.9d; //txtSize = length / factor; txtSize = GetTextSize(); vtxtStartNode.TextString = mi.StartNode.NodeNo.ToString(); vtxtStartNode.Height = txtSize; //vtxtStartNode.Height = 0.9d; //vtxtStartNode.PenColor = new vdColor(Color.Green); vtxtStartNode.InsertionPoint = mi.StartNode.Point; vtxtStartNode.Layer = nodesLay; vtxtEndNode.TextString = mi.EndNode.NodeNo.ToString(); vtxtEndNode.Height = txtSize; //vtxtEndNode.Height = 0.9d; //vtxtEndNode.PenColor = new vdColor(Color.Green); vtxtEndNode.InsertionPoint = mi.EndNode.Point; vtxtEndNode.Layer = nodesLay; vtxtMemberNo.TextString = mi.MemberNo.ToString(); //vtxtMemberNo.Height = 0.9d; vtxtMemberNo.Height = txtSize; vtxtMemberNo.PenColor = new vdColor(Color.Blue); vtxtMemberNo.InsertionPoint = (mi.StartNode.Point + mi.EndNode.Point) / 2; vtxtMemberNo.Layer = membersLay; vtxtMemberNo.ToolTip = string.Format("Member No : {0} [Nodes ({1}, {2})]", mi.MemberNo, mi.StartNode.NodeNo, mi.EndNode.NodeNo); //doc.ZoomAll(); //doc.Redraw(true); }
public static void CmdPipe3DFromText(vdDocument doc, string txtFileName) { Color pipeColor = Color.Green; double pipeSize = 100.0d; vdLayer pipeLay = new vdLayer(); pipeLay.Name = "Pipes"; pipeLay.SetUnRegisterDocument(doc); pipeLay.setDocumentDefaults(); doc.Layers.AddItem(pipeLay); doc.ActiveLayer = pipeLay; vdLayer nodeBallLay = new vdLayer(); nodeBallLay.Name = "NodalData"; nodeBallLay.SetUnRegisterDocument(doc); nodeBallLay.setDocumentDefaults(); doc.Layers.AddItem(nodeBallLay); nodeBallLay.PenColor = new vdColor(Color.Red); string fName = txtFileName; ReadPipes(fName); HEADSNeed.DisNet.frmDrawPipe fdp = new HEADSNeed.DisNet.frmDrawPipe(); if (fdp.ShowDialog() == DialogResult.OK) { pipeColor = fdp.PipeColor; pipeSize = fdp.PipeSize; //doc.ActiveLayer.PenColor = new vdColor(pipeColor); pipeLay.PenColor = new vdColor(pipeColor); } else { return; } for (int i = 0; i < lstPipe.Count; i++) { try { DisNetPipe dnPipe = lstPipe[i]; vdCircle cir = new vdCircle(); cir.Center = dnPipe.StartPoint; cir.Radius = dnPipe.Diameter * pipeSize; //cir.Radius = dnPipe.Diameter; cir.ExtrusionVector = Vector.CreateExtrusion(dnPipe.StartPoint, dnPipe.EndPoint); cir.SetUnRegisterDocument(doc); cir.setDocumentDefaults(); cir.Layer = pipeLay; doc.ActionLayout.Entities.AddItem(cir); cir.Thickness = dnPipe.Length; //cir.PenColor = new vdColor(cl); doc.CommandAction.CmdSphere(dnPipe.EndPoint, cir.Radius, 10, 10); doc.ActiveLayer = nodeBallLay; doc.CommandAction.CmdSphere(dnPipe.EndPoint, cir.Radius + 5.0d, 15, 10); doc.ActiveLayer = pipeLay; doc.CommandAction.Zoom("E", 100, 100); if (i == 0) { vdPolyline pline = new vdPolyline(); pline.VertexList.Add(new gPoint(cir.Center.x - 35.0d, cir.Center.y + 25.0d, cir.Center.z)); pline.VertexList.Add(new gPoint(cir.Center.x - 35.0d, cir.Center.y, cir.Center.z)); pline.VertexList.Add(new gPoint(cir.Center.x + 35.0d, cir.Center.y, cir.Center.z)); pline.VertexList.Add(new gPoint(cir.Center.x + 35.0d, cir.Center.y + 25.0d, cir.Center.z)); pline.SetUnRegisterDocument(doc); pline.setDocumentDefaults(); pline.PenColor = new vdColor(Color.LightPink); pline.PenWidth = 2.0d; doc.ActionLayout.Entities.AddItem(pline); vdLine ln = new vdLine(); ln.SetUnRegisterDocument(doc); ln.setDocumentDefaults(); ln.StartPoint = (pline.VertexList[0] + pline.VertexList[1]) / 2; ln.EndPoint = (pline.VertexList[2] + pline.VertexList[3]) / 2; ln.PenColor = new vdColor(Color.LightPink); ln.PenWidth = 2.0d; doc.ActionLayout.Entities.AddItem(ln); vdText tx = new vdText(); tx.SetUnRegisterDocument(doc); tx.setDocumentDefaults(); tx.InsertionPoint = new gPoint(ln.StartPoint.x + 2.0d, ln.StartPoint.y + 3.0d, ln.StartPoint.z); tx.TextString = "SOURCE"; tx.PenColor = new vdColor(Color.LightPink); tx.Height = 10.0d; doc.ActionLayout.Entities.AddItem(tx); } //doc.Redraw(true); } catch (Exception exx) { } } doc.RenderMode = vdRender.Mode.Wire2dGdiPlus; doc.CommandAction.RegenAll(); doc.Redraw(true); }
public void DrawEnvelop(vdDocument doc) { if (Members == null) { Set_Members(); } vdLayer elementLay = new vdLayer(); elementLay.Name = "ENVELOPE"; elementLay.SetUnRegisterDocument(doc); elementLay.setDocumentDefaults(); elementLay.PenColor = new vdColor(Color.DarkGreen); doc.Layers.AddItem(elementLay); doc.Palette.Background = Color.White; VectorDraw.Professional.vdFigures.vdPolyline one3dface = new vdPolyline(); vdLine ln = null; vdMText mtxt = null; one3dface.SetUnRegisterDocument(doc); one3dface.setDocumentDefaults(); VectorDraw.Geometry.gPoint gp = new VectorDraw.Geometry.gPoint(); for (var item = 0; item < Members.Count; item++) { ln = new vdLine(); ln.SetUnRegisterDocument(doc); ln.setDocumentDefaults(); mtxt = new vdMText(); mtxt.SetUnRegisterDocument(doc); mtxt.setDocumentDefaults(); mtxt.HorJustify = VdConstHorJust.VdTextHorCenter; mtxt.Height = 0.3; mtxt.TextString = Forces[item].ToString("f3"); mtxt.Layer = elementLay; gp = new gPoint(); gp.x = (Members[item].StartNode.Point.x + Members[item].EndNode.Point.x) / 2; gp.y = Members[item].StartNode.Point.y; gp.z = Members[item].StartNode.Point.z; ln.StartPoint = gp; gp = new gPoint(); gp.x = (Members[item].StartNode.Point.x + Members[item].EndNode.Point.x) / 2; gp.y = Members[item].EndNode.Point.y + Forces[item] * factor; gp.z = Members[item].StartNode.Point.z; ln.EndPoint = gp; mtxt.InsertionPoint = gp; doc.ActiveLayOut.Entities.AddItem(mtxt); ln.Layer = elementLay; doc.ActiveLayOut.Entities.AddItem(ln); one3dface.VertexList.Add(gp); Members.DrawMember(Members[item], doc); } one3dface.SPlineFlag = VdConstSplineFlag.SFlagFITTING; one3dface.Layer = elementLay; doc.ActiveLayOut.Entities.AddItem(one3dface); //VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_ShadeOn(doc); }
public void Moving_Line() { #region ASTRA if (AST_DOC_ORG.IsMovingLoad) { AST_DOC.Members.DrawMember(doc); //Draw_ASTRA_Joint_Load(); vdLine ln = new vdLine(); ln.SetUnRegisterDocument(doc); ln.setDocumentDefaults(); //ln.StartPoint = new gPoint(0, max_y + 3); //ln.EndPoint = new gPoint(max_x, max_y + 3); ln.StartPoint.x = AST_DOC_ORG.Joints.BoundingBox.Left; ln.StartPoint.y = AST_DOC_ORG.Joints.BoundingBox.Top + 2; ln.EndPoint.x = AST_DOC_ORG.Joints.BoundingBox.Right; ln.EndPoint.y = AST_DOC_ORG.Joints.BoundingBox.Top + 2; doc.ActiveLayOut.Entities.AddItem(ln); double xinc = AST_DOC_ORG.Load_Geneartion[0].XINC; vdMText wheelPos = new vdMText(); wheelPos.SetUnRegisterDocument(doc); wheelPos.setDocumentDefaults(); //wheelPos.TextString = "WHEEL POSITION [ INCREMENT = " + xinc + " m. ], DECK SPAN LENGTH = " + max_x + " m."; wheelPos.TextString = "WHEEL POSITION [ INCREMENT = " + xinc + " m. ], DECK SPAN LENGTH = " + AST_DOC_ORG.Joints.BoundingBox.Width + " m."; wheelPos.InsertionPoint.x = AST_DOC_ORG.Joints.BoundingBox.MidPoint.x; wheelPos.InsertionPoint.y = AST_DOC_ORG.Joints.BoundingBox.Top + 2.5; wheelPos.HorJustify = VectorDraw.Professional.Constants.VdConstHorJust.VdTextHorCenter; wheelPos.VerJustify = VectorDraw.Professional.Constants.VdConstVerJust.VdTextVerCen; //wheelPos.InsertionPoint.x -= 2.4; //wheelPos.InsertionPoint.y -= 0.4; wheelPos.Height = 0.24; doc.ActiveLayOut.Entities.AddItem(wheelPos); vdMText nodalLoad = new vdMText(); nodalLoad.SetUnRegisterDocument(doc); nodalLoad.setDocumentDefaults(); nodalLoad.TextString = "NODAL LOADS"; nodalLoad.InsertionPoint.x = AST_DOC_ORG.Joints.BoundingBox.MidPoint.x; nodalLoad.InsertionPoint.y = AST_DOC.Joints.BoundingBox.Bottom - 2.0; nodalLoad.HorJustify = VectorDraw.Professional.Constants.VdConstHorJust.VdTextHorCenter; nodalLoad.VerJustify = VectorDraw.Professional.Constants.VdConstVerJust.VdTextVerCen; nodalLoad.Height = 0.25; nodalLoad.PenColor = new vdColor(Color.Red); doc.ActiveLayOut.Entities.AddItem(nodalLoad); ln = new vdLine(); ln.SetUnRegisterDocument(doc); ln.setDocumentDefaults(); ln.StartPoint.x = AST_DOC_ORG.Joints.BoundingBox.Left; ln.StartPoint.y = AST_DOC_ORG.Joints.BoundingBox.Top + 3.0; ln.EndPoint.x = AST_DOC_ORG.Joints.BoundingBox.Right; ln.EndPoint.y = AST_DOC_ORG.Joints.BoundingBox.Top + 3.0; doc.ActiveLayOut.Entities.AddItem(ln); double dx, dy, dz; int no = (int)(max_x / xinc); for (int n = 0; n < no; n++) { dx = AST_DOC_ORG.Joints.BoundingBox.Left + n * xinc; dy = AST_DOC_ORG.Joints.BoundingBox.Bottom; ln = new vdLine(); ln.SetUnRegisterDocument(doc); ln.setDocumentDefaults(); ln.StartPoint = new gPoint(dx, dy); ln.EndPoint = new gPoint(dx, dy - 0.05); doc.ActiveLayOut.Entities.AddItem(ln); } } #endregion }
public void Draw_StructureGraph(vdDocument document, int SpanNo, int LoadCase, bool IsShear) { //Jay Shree Krishna //Jay Shree Ganesh document.ActiveLayOut.Entities.RemoveAll(); #region MainLIne vdLine mainLine = new vdLine(); mainLine.SetUnRegisterDocument(document); mainLine.setDocumentDefaults(); mainLine.StartPoint = new gPoint(10.0d, 10.0d); mainLine.EndPoint = new gPoint(30.0d, 10.0d); document.ActiveLayOut.Entities.AddItem(mainLine); #endregion #region Side Line 1 vdLine sideLine1 = new vdLine(); sideLine1.SetUnRegisterDocument(document); sideLine1.setDocumentDefaults(); sideLine1.StartPoint = new gPoint(10, 5); sideLine1.EndPoint = new gPoint(10, 15); document.ActiveLayOut.Entities.AddItem(sideLine1); #endregion #region Side Line 2 vdLine sideLine2 = new vdLine(); sideLine2.SetUnRegisterDocument(document); sideLine2.setDocumentDefaults(); sideLine2.StartPoint = new gPoint(30, 5); sideLine2.EndPoint = new gPoint(30, 15); document.ActiveLayOut.Entities.AddItem(sideLine2); #endregion #region Draw PolyLine vdPolyline pLine = new vdPolyline(); pLine.SetUnRegisterDocument(document); pLine.setDocumentDefaults(); //pLine.VertexList.Add(mainLine.StartPoint); double st, en, highest; st = en = highest = 0.0d; if (IsShear) { highest = MaxShear(SpanNo); } else { highest = MaxMoment(SpanNo); } double xIncr = 0.0d; for (int i = 0; i < list.Count; i++) { if (list[i].SpanNo == SpanNo) { if (IsShear) { st = list[i].Shear; } else { st = list[i].Moment; } gPoint gp = new gPoint(); gp.x = mainLine.StartPoint.x + xIncr; xIncr += 2.0d; st = -st; if (st > 0) { gp.y = mainLine.StartPoint.y + (sideLine1.EndPoint.y - mainLine.StartPoint.y) * (st / highest); } else { gp.y = mainLine.StartPoint.y - (sideLine1.StartPoint.y - mainLine.StartPoint.y) * (st / highest); } pLine.VertexList.Add(gp); vdLine vLine = new vdLine(); vLine.SetUnRegisterDocument(document); vLine.setDocumentDefaults(); vLine.StartPoint = gp; vLine.EndPoint = new gPoint(gp.x, mainLine.StartPoint.y); document.ActiveLayOut.Entities.AddItem(vLine); vdText yValue = new vdText(); yValue.SetUnRegisterDocument(document); yValue.setDocumentDefaults(); yValue.InsertionPoint = vLine.EndPoint; yValue.TextString = st.ToString(); if (st > 0) { yValue.Rotation = 270.0d * Math.PI / 180.0d; yValue.InsertionPoint.x -= 0.25d; yValue.InsertionPoint.y -= 0.5d; } else { yValue.Rotation = 90.0d * Math.PI / 180.0d; yValue.InsertionPoint.x += 0.25d; yValue.InsertionPoint.y += 0.5d; } yValue.Height = 1.0d; document.ActiveLayOut.Entities.AddItem(yValue); } } document.ShowUCSAxis = false; document.ActiveLayOut.Entities.AddItem(pLine); //if (st > 0) //{ // beamLine.StartPoint.x = midLine.StartPoint.x + (line1.EndPoint.x - midLine.StartPoint.x) * (st / highest); // beamLine.StartPoint.y = midLine.StartPoint.y + (line1.EndPoint.y - midLine.StartPoint.y) * (st / highest); // beamLine.StartPoint.z = midLine.StartPoint.z + (line1.EndPoint.z - midLine.StartPoint.z) * (st / highest); //} //else //{ // beamLine.StartPoint.x = midLine.StartPoint.x - (line1.StartPoint.x - midLine.StartPoint.x) * (st / highest); // beamLine.StartPoint.y = midLine.StartPoint.y - (line1.StartPoint.y - midLine.StartPoint.y) * (st / highest); // beamLine.StartPoint.z = midLine.StartPoint.z - (line1.StartPoint.z - midLine.StartPoint.z) * (st / highest); //} //if (en > 0) //{ // beamLine.EndPoint.x = midLine.EndPoint.x + (line2.EndPoint.x - midLine.EndPoint.x) * (en / highest); // beamLine.EndPoint.y = midLine.EndPoint.y + (line2.EndPoint.y - midLine.EndPoint.y) * (en / highest); // beamLine.EndPoint.z = midLine.EndPoint.z + (line2.EndPoint.z - midLine.EndPoint.z) * (en / highest); //} //else //{ // beamLine.EndPoint.x = midLine.EndPoint.x - (line2.StartPoint.x - midLine.EndPoint.x) * (en / highest); // beamLine.EndPoint.y = midLine.EndPoint.y - (line2.StartPoint.y - midLine.EndPoint.y) * (en / highest); // beamLine.EndPoint.z = midLine.EndPoint.z - (line2.StartPoint.z - midLine.EndPoint.z) * (en / highest); //} #endregion #region Draw Rectangle vdRect rect = new vdRect(); rect.SetUnRegisterDocument(document); rect.setDocumentDefaults(); rect.InsertionPoint = new gPoint(sideLine1.StartPoint.x - 2, sideLine1.StartPoint.y - 2); rect.Width = 23.0d; rect.Height = 13.0d; document.ActiveLayOut.Entities.AddItem(rect); #endregion document.Redraw(true); VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VTop(document); }
public static void CmdASTRAMemberLoad1(vdDocument document) { gPoint EPT, SPT; document.Prompt("Start Point:"); object ret = document.ActionUtility.getUserPoint(); document.Prompt(null); if (ret == null || !(ret is gPoint)) { return; } SPT = ret as gPoint; ActionASTRAMemberLoad aFig = new ActionASTRAMemberLoad(SPT, document.ActiveLayOut); document.Prompt("End Point :"); document.ActionAdd(aFig); StatusCode scode = aFig.WaitToFinish(); document.Prompt(null); if (scode != VectorDraw.Actions.StatusCode.Success) { return; } EPT = aFig.Value as gPoint; vdLine line1 = new vdLine(); line1.SetUnRegisterDocument(document); line1.setDocumentDefaults(); line1.StartPoint = SPT; line1.EndPoint = EPT; document.ActiveLayOut.Entities.AddItem(line1); vdLine line2 = new vdLine(); line2.SetUnRegisterDocument(document); line2.setDocumentDefaults(); line2.StartPoint = new gPoint(SPT.x, SPT.y - 1, SPT.z); line2.EndPoint = new gPoint(EPT.x, EPT.y - 1, EPT.z); document.ActiveLayOut.Entities.AddItem(line2); ASTRAMemberLoad aline = new ASTRAMemberLoad(); document.ActionLayout.Entities.AddItem(aline); document.UndoHistory.PushEnable(false); aline.InitializeProperties(); aline.setDocumentDefaults(); aline.StartPoint = line1.StartPoint; aline.EndPoint = line2.StartPoint; aline.arrowSize = 0.3; aline.Transformby(document.User2WorldMatrix); document.UndoHistory.PopEnable(); document.ActionDrawFigure(aline); ASTRAMemberLoad aline1 = new ASTRAMemberLoad(); document.ActionLayout.Entities.AddItem(aline1); document.UndoHistory.PushEnable(false); aline1.InitializeProperties(); aline1.setDocumentDefaults(); aline1.arrowSize = 0.3; aline1.StartPoint = line1.EndPoint; aline1.EndPoint = line2.EndPoint; aline1.Transformby(document.User2WorldMatrix); document.UndoHistory.PopEnable(); document.ActionDrawFigure(aline); document.Redraw(true); }
public static void CmdASTRAMemberLoad3(vdDocument document, gPoint StartPoint, gPoint EndPoint) { gPoint EPT, SPT; SPT = StartPoint; EPT = EndPoint; vdLine line1 = new vdLine(); line1.SetUnRegisterDocument(document); line1.setDocumentDefaults(); line1.StartPoint = SPT; line1.EndPoint = EPT; document.ActiveLayOut.Entities.AddItem(line1); vdLine line2 = new vdLine(); line2.SetUnRegisterDocument(document); line2.setDocumentDefaults(); line2.StartPoint = new gPoint(SPT.x, SPT.y - 1, SPT.z); line2.EndPoint = new gPoint(EPT.x, EPT.y - 1, EPT.z); document.ActiveLayOut.Entities.AddItem(line2); ASTRAMemberLoad aline = new ASTRAMemberLoad(); document.ActionLayout.Entities.AddItem(aline); document.UndoHistory.PushEnable(false); aline.InitializeProperties(); aline.setDocumentDefaults(); aline.StartPoint = line2.StartPoint; aline.EndPoint = line1.StartPoint; aline.arrowSize = 0.3; aline.Transformby(document.User2WorldMatrix); document.UndoHistory.PopEnable(); document.ActionDrawFigure(aline); double ll = ((line1.Length() / 5.0d) / line1.Length()); double sx, sy, sz; double ex, ey, ez; sx = sy = sz = 0.0d; for (int j = 1; j <= 5; j++) { ASTRAMemberLoad aline1 = new ASTRAMemberLoad(); document.ActionLayout.Entities.AddItem(aline1); document.UndoHistory.PushEnable(false); aline1.InitializeProperties(); aline1.setDocumentDefaults(); aline1.arrowSize = 0.3; sx = (j * ll) * (line2.EndPoint.x - line2.StartPoint.x) + line2.StartPoint.x; sy = (j * ll) * (line2.EndPoint.y - line2.StartPoint.y) + line2.StartPoint.y; sz = (j * ll) * (line2.EndPoint.z - line2.StartPoint.z) + line2.StartPoint.z; aline1.StartPoint = new gPoint(sx, sy, sz); ex = (j * ll) * (line1.EndPoint.x - line1.StartPoint.x) + line1.StartPoint.x; ey = (j * ll) * (line1.EndPoint.y - line1.StartPoint.y) + line1.StartPoint.y; ez = (j * ll) * (line1.EndPoint.z - line1.StartPoint.z) + line1.StartPoint.z; aline1.EndPoint = new gPoint(ex, ey, ez); aline1.Transformby(document.User2WorldMatrix); document.UndoHistory.PopEnable(); document.ActionDrawFigure(aline); } document.Redraw(true); }
public static void DrawHrdrographFromDataFile(string data_file, vdDocument vdDoc) { List <HydroData> list_hydro_coll = new List <HydroData>(); MyStrings mlist = null; List <string> file_content = new List <string>(File.ReadAllLines(data_file)); string kStr = ""; HydroData hdr = null; vdMText mtext = null; vdPolyline pl = null; vdCircle cir = null; vdRect rect = null; double min_x, min_y; double max_x, max_y; min_x = double.MaxValue; min_y = min_x; max_x = double.MinValue; max_y = max_x; bool flag = false; double min_foundation_Level = 0.0, Max_Scour_Depth = 0.0; foreach (var item in file_content) { kStr = item.Replace(",", " "); kStr = item.Replace("=", " "); kStr = MyStrings.RemoveAllSpaces(kStr.ToUpper()); mlist = new MyStrings(kStr, ' '); if (kStr.ToUpper().Contains("DISTANCE")) { flag = true; } if (mlist.StringList[0] == "MIN_FOUNDATION_LEVEL") { min_foundation_Level = mlist.GetDouble(1); } if (mlist.StringList[0] == "MAXIMUM_SCOUR_DEPTH") { Max_Scour_Depth = mlist.GetDouble(1); } //sw.WriteLine("MIN_FOUNDATION_LEVEL = {0}", min_foundation_Level); //sw.WriteLine("MAXIMUM_SCOUR_DEPTH = {0}", Max_Scour_Depth); if (flag == false) { continue; } try { hdr = new HydroData(); hdr.SerialNo = list_hydro_coll.Count + 1; hdr.Distance = mlist.GetDouble(0, -999.0); if (hdr.Distance == -999.0) { throw (new Exception()); } hdr.WaterLevel = mlist.GetDouble(1); list_hydro_coll.Add(hdr); if (min_x > hdr.Distance) { min_x = hdr.Distance; } if (min_y > hdr.WaterLevel) { min_y = hdr.WaterLevel; } if (max_x < hdr.Distance) { max_x = hdr.Distance; } if (max_y < hdr.WaterLevel) { max_y = hdr.WaterLevel; } } catch (Exception ex) { } } pl = new vdPolyline(); pl.SetUnRegisterDocument(vdDoc); pl.setDocumentDefaults(); foreach (var item in list_hydro_coll) { cir = new vdCircle(); cir.SetUnRegisterDocument(vdDoc); cir.setDocumentDefaults(); cir.Center = new VectorDraw.Geometry.gPoint(item.Distance, item.WaterLevel); cir.Radius = 0.09; cir.PenColor = new vdColor(Color.GreenYellow); vdDoc.ActiveLayOut.Entities.AddItem(cir); pl.VertexList.Add(cir.Center); } pl.PenColor = new vdColor(Color.Red); vdDoc.ActiveLayOut.Entities.AddItem(pl); vdLine ln_min_found = new vdLine(); ln_min_found.SetUnRegisterDocument(vdDoc); ln_min_found.setDocumentDefaults(); ln_min_found.StartPoint.x = pl.BoundingBox.Left; ln_min_found.StartPoint.y = pl.BoundingBox.Bottom - min_foundation_Level; ln_min_found.EndPoint.x = pl.BoundingBox.Right; ln_min_found.EndPoint.y = pl.BoundingBox.Bottom - min_foundation_Level; vdDoc.ActiveLayOut.Entities.AddItem(ln_min_found); mtext = new vdMText(); mtext.SetUnRegisterDocument(vdDoc); mtext.setDocumentDefaults(); mtext.InsertionPoint.x = ln_min_found.StartPoint.x; mtext.InsertionPoint.y = ln_min_found.StartPoint.y - 0.2; mtext.Height = 0.3; //mtext.Rotation = 90 * Math.PI / 180.0; mtext.TextString = "Depth from LBL to minimum Foundation Level = " + min_foundation_Level.ToString("0.0000"); mtext.PenColor = new vdColor(Color.Cyan); vdDoc.ActiveLayOut.Entities.AddItem(mtext); vdLine ln_max_scour = new vdLine(); ln_max_scour.SetUnRegisterDocument(vdDoc); ln_max_scour.setDocumentDefaults(); ln_max_scour.StartPoint.x = pl.BoundingBox.Left; ln_max_scour.StartPoint.y = pl.BoundingBox.Bottom - Max_Scour_Depth; ln_max_scour.EndPoint.x = pl.BoundingBox.Right; ln_max_scour.EndPoint.y = pl.BoundingBox.Bottom - Max_Scour_Depth; vdDoc.ActiveLayOut.Entities.AddItem(ln_max_scour); mtext = new vdMText(); mtext.SetUnRegisterDocument(vdDoc); mtext.setDocumentDefaults(); mtext.InsertionPoint = ln_max_scour.StartPoint; mtext.InsertionPoint.y -= 0.2; mtext.Height = 0.3; //mtext.Rotation = 90 * Math.PI / 180.0; mtext.TextString = "Maximum Scour Depth obtained = " + Max_Scour_Depth.ToString("0.0000"); mtext.PenColor = new vdColor(Color.Cyan); vdDoc.ActiveLayOut.Entities.AddItem(mtext); //Maximum Scour Depth adopted = //Depth from LBL to minimum Foundation Level //vdRect rect = null; rect = new vdRect(); rect.SetUnRegisterDocument(vdDoc); rect.setDocumentDefaults(); rect.InsertionPoint.x = pl.BoundingBox.Left - 2; if (min_foundation_Level > Max_Scour_Depth) { rect.InsertionPoint.y = pl.BoundingBox.Bottom - 2 - min_foundation_Level; } else { rect.InsertionPoint.y = pl.BoundingBox.Bottom - 2 - Max_Scour_Depth; } rect.Width = pl.BoundingBox.Width + 4; //rect.Height = -pl.BoundingBox.Height; rect.Height = -2; vdDoc.ActiveLayOut.Entities.AddItem(rect); vdLine ln = new vdLine(); ln.SetUnRegisterDocument(vdDoc); ln.setDocumentDefaults(); ln.StartPoint.x = rect.BoundingBox.Left; ln.StartPoint.y = rect.BoundingBox.Bottom + 1; ln.EndPoint.x = rect.BoundingBox.Right; ln.EndPoint.y = rect.BoundingBox.Bottom + 1; vdDoc.ActiveLayOut.Entities.AddItem(ln); foreach (var item in list_hydro_coll) { mtext = new vdMText(); mtext.SetUnRegisterDocument(vdDoc); mtext.setDocumentDefaults(); mtext.InsertionPoint.x = item.Distance; mtext.InsertionPoint.y = ln.BoundingBox.Bottom + 0.2; mtext.Height = 0.1; mtext.Rotation = 90 * Math.PI / 180.0; mtext.TextString = item.WaterLevel.ToString("0.0000"); mtext.PenColor = new vdColor(Color.Cyan); vdDoc.ActiveLayOut.Entities.AddItem(mtext); mtext = new vdMText(); mtext.SetUnRegisterDocument(vdDoc); mtext.setDocumentDefaults(); mtext.InsertionPoint.x = item.Distance; mtext.InsertionPoint.y = rect.BoundingBox.Bottom + 0.2; mtext.Height = 0.1; mtext.Rotation = 90 * Math.PI / 180.0; mtext.TextString = item.Distance.ToString("0.0000"); mtext.PenColor = new vdColor(Color.LightGreen); vdDoc.ActiveLayOut.Entities.AddItem(mtext); } mtext = new vdMText(); mtext.SetUnRegisterDocument(vdDoc); mtext.setDocumentDefaults(); mtext.InsertionPoint.x = rect.BoundingBox.Left + 0.2; mtext.InsertionPoint.y = rect.BoundingBox.Top + 0.2; mtext.Height = 0.11; //mtext.Rotation = 90 * Math.PI / 180.0; mtext.TextString = "DATUM = " + rect.BoundingBox.Top.ToString("0.00"); vdDoc.ActiveLayOut.Entities.AddItem(mtext); mtext = new vdMText(); mtext.SetUnRegisterDocument(vdDoc); mtext.setDocumentDefaults(); mtext.InsertionPoint.x = rect.BoundingBox.Left + 0.2; mtext.InsertionPoint.y = ln.BoundingBox.Bottom + 0.5; mtext.Height = 0.1; //mtext.Rotation = 90 * Math.PI / 180.0; mtext.TextString = "RIVER BED LEVEL (m)"; mtext.PenColor = new vdColor(Color.Cyan); vdDoc.ActiveLayOut.Entities.AddItem(mtext); mtext = new vdMText(); mtext.SetUnRegisterDocument(vdDoc); mtext.setDocumentDefaults(); mtext.InsertionPoint.x = rect.BoundingBox.Left + 0.2; mtext.InsertionPoint.y = rect.BoundingBox.Bottom + 0.5; mtext.Height = 0.1; //mtext.Rotation = 90 * Math.PI / 180.0; mtext.TextString = "DISTANCE (m)"; mtext.PenColor = new vdColor(Color.LightGreen); vdDoc.ActiveLayOut.Entities.AddItem(mtext); ln = new vdLine(); ln.SetUnRegisterDocument(vdDoc); ln.setDocumentDefaults(); ln.StartPoint.x = rect.BoundingBox.Left + 1.8; ln.StartPoint.y = rect.BoundingBox.Bottom; ln.EndPoint.x = rect.BoundingBox.Left + 1.8; ln.EndPoint.y = rect.BoundingBox.Top; vdDoc.ActiveLayOut.Entities.AddItem(ln); vdRect over_box = new vdRect(); over_box.SetUnRegisterDocument(vdDoc); over_box.setDocumentDefaults(); over_box.InsertionPoint.x = rect.BoundingBox.Left - 2; over_box.InsertionPoint.y = rect.BoundingBox.Bottom - 1; over_box.Width = rect.BoundingBox.Width + 4; over_box.Height = (pl.BoundingBox.Top - rect.BoundingBox.Bottom) + 2; vdDoc.ActiveLayOut.Entities.AddItem(over_box); VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VTop(vdDoc); vdDoc.Redraw(true); }
/**/ public bool CalculateProgram(string fileName) { bool bSuccess = false; filePath = Path.GetDirectoryName(fileName); StreamWriter sw = new StreamWriter(new FileStream(fileName, FileMode.Create)); StreamWriter filFile = new StreamWriter(new FileStream(Path.Combine(Path.GetDirectoryName(fileName), "DESIGN.FIL"), FileMode.Create)); try { // Step 1 //eH.depth = totalLength = l * 1000 + b1 + b2; double d = (l * 1000 + ((b1 + b2) / 2)) / (20 * 1.5); // eH_depth sw.WriteLine("****************************************************************"); //sw.WriteLine("DESIGN OF SINGLE SPAN ONE WAY RCC SLAB BY WORKING STRESS METHOD"); sw.WriteLine("----------------------------------------------------------------------------------------------"); sw.WriteLine("----------------------------------------------------------------------------------------------"); sw.WriteLine("\t\t\t**********************************************"); sw.WriteLine("\t\t\t* ASTRA Pro Release 2009 *"); sw.WriteLine("\t\t\t* TechSOFT Engineering Services (I) Pvt. Ltd.*"); sw.WriteLine("\t\t\t* *"); sw.WriteLine("\t\t\t* DESIGN OF SINGLE SPAN *"); sw.WriteLine("\t\t\t* ONE WAY RCC SLAB BY WORKING STRESS METHOD *"); sw.WriteLine("\t\t\t**********************************************"); sw.WriteLine("\t\t\t----------------------------------------------"); sw.WriteLine("\t\t\tTHIS RESULT CREATED ON " + System.DateTime.Now.ToString("dd.MM.yyyy AT HH:mm:ss") + " "); sw.WriteLine("\t\t\t----------------------------------------------"); sw.WriteLine(); sw.WriteLine(); sw.WriteLine(); sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("■ Step 1:"); sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine(""); sw.WriteLine("Eff_Depth = (({0} + {1})/20 * 1.5) = {2} mm.", (l * 1000.0d).ToString("0.0"), ((b1 + b2) / 2).ToString("0.0"), d.ToString("0.00")); d = d / 10.0d; d = (double)((int)d) * 10; //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("Let us Provide eff. depth = {0} mm.", d); //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("Using {0}Ø rod and providing a clear cover of {1} mm.", d1, h1); D = d + h1 + (d1 / 2.0d); //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("Provide overall depth = {0} + {1} = {2} mm.", d, (h1 + (d1 / 2)).ToString("0.00"), D); //Step 2 // EH_Span should be the less of the followings l = l * 1000; double EH_Span = l + (b1 / 2.0d) + (b2 / 2.0d); sw.WriteLine(""); sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("■ Step 2:"); sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine(""); sw.WriteLine("Eff Span should be the less of the following :"); double l1 = EH_Span; double l2 = l + d; //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("(i) c/c distance between the support = {0} mm.", l1); //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("(ii) Clear Span + eff. depth of slab = {0} + {1} = {2} mm.", l, d, l2); //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("▲ Provide effective span l = {0} mm.", ((l1 > l2) ? l2 : l1)); //sw.WriteLine("--------------------------------------------------------------------"); // Step 3 // Load calculation Considering 1 m width of the Slab. // Dead Load of the Slab dl = (D / 1000.0d) * gamma_c; sw.WriteLine(""); sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("■ Step 3:"); sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine(""); sw.WriteLine("Load Calculation Considering 1 m width of the slab."); //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("Dead Load of the Slab = {0} * {1} = {2} N/m.", (D / 1000.0).ToString("0.00"), gamma_c, dl); sw.WriteLine("Floor Finish + Ceiling plaster = {0} N/m.", w1); sw.WriteLine("Live Load = {0} N/m.", w2); double w = dl + w1 + w2; //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine(" Total Load w = {0} N/m.", w); // Step 4 //Design Moment M = w*l*l/8 l = l / 1000.0d; double M = w * l * l / 8; double eff_depth_reqd = Math.Sqrt((M * 1000.0d) / (0.848 * 1000.0d)); sw.WriteLine(""); sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("■ Step 4:"); sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine(""); sw.WriteLine("Design moment M = (w*l*l/8) = {0} N-m.", M.ToString("0.00")); //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("Now eff depth reqd. = √(M/Qb) = √({0}/({1}) = {2} mm. ", (M * 1000.0d).ToString("0.00"), (0.848 * 1000.0d).ToString("0.000"), eff_depth_reqd.ToString("0.00")); if (eff_depth_reqd < 90) { sw.WriteLine("So, the eff depth provided is OK.({0} mm < 90 mm)", eff_depth_reqd.ToString("0.00")); } else { sw.WriteLine("So, the eff depth provided is not OK. ({0} mm > 90 mm)", eff_depth_reqd.ToString("0.00")); } // Step 5 // Required Ast double Ast = ((M * 1000.0d) / (sigma_st * 0.87 * d)); double a_st = (Math.PI * (d1 * d1) / 4.0d); double no_rod = Ast / a_st; s1 = (1000.0 * a_st) / Ast; // Spacing int iS1 = (int)(s1 / 10); sw.WriteLine(""); sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("■ Step 5:"); sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine(""); sw.WriteLine("Required Ast = {0} sq.mm.", eff_depth_reqd); //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("No of rod = ({0} / {1} = (Providing {2}Ø rod, c/s area of rod = {1} sq.mm.", Ast, a_st.ToString("0.00"), d1); //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("Spacing = ({0} * {1}) / {2} = {3} mm.", 1000, a_st.ToString("0.00"), Ast.ToString("0.00"), s1.ToString("0.00")); s1 = iS1 * 10.0d; //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("So we shall provide {0}Ø rod @ {1} mm c/c.", d1, s1); if (s1 < 450 && s1 < 3 * d) { //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("So, the eff depth provided is OK.({0} mm < 90 mm)", eff_depth_reqd.ToString("0.00")); } else { //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("So, the eff depth provided is not OK. ({0} mm > 90 mm)", eff_depth_reqd.ToString("0.00")); } //Step 6 dst = (dst * 1000.0 * D / 100.0); sw.WriteLine(""); sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("■ Step 6:"); sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine(""); sw.WriteLine("Area of distribution steal = {0} sq.mm.", dst.ToString("0.00")); double rod_Spacing = ((Math.PI * (d2 * d2) / 4)); rod_Spacing = rod_Spacing * 1000 / Dst; //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("Using {0}Ø rod spacing = {1} c/c", d2, rod_Spacing.ToString("0.00")); iS1 = (int)rod_Spacing / 10; rod_Spacing = iS1 * 10.0d; s2 = rod_Spacing; //sw.WriteLine("--------------------------------------------------------------------"); sw.WriteLine("So we provide distribution steal @ {0} mm c/c.", rod_Spacing.ToString("0.00")); sw.WriteLine(); sw.WriteLine(); sw.WriteLine("****************************************************************"); sw.WriteLine(" ***************** END OF REPORT *************"); sw.WriteLine("****************************************************************"); bSuccess = true; //DrawSlab01((,1000,D,180,170)); //DrawSlab01(totalLength, 1000.0d, D, 180, 170); filFile.WriteLine("SLAB DESIGN"); filFile.WriteLine("100 L = {0} mm; B = {1} m; D = {2} mm", (l * 1000 + b1 + b2).ToString("0.00"), 1000, D.ToString("0.00")); filFile.WriteLine("101 h1 = {0} mm; h2 = {1} mm", h1.ToString("0.00"), h1.ToString("0.00")); filFile.WriteLine("102 d1 = {0} mm; d2 = {1} mm", d1.ToString("0.00"), d2.ToString("0.00")); filFile.WriteLine("103 Gamma_C = {0} mm; Sigma_St = {1} mm", d1.ToString("0.00"), d2.ToString("0.00")); filFile.WriteLine("104 Gc = {0} mm; l = {1} mm", Gc.ToString("0.00"), l.ToString("0.00")); filFile.WriteLine("105 b1 = {0} mm; b2 = {1} mm", b1.ToString("0.00"), l.ToString("0.00")); filFile.WriteLine("ENFORCEMENT BAR"); filFile.WriteLine("B1 = {0} mm; MAIN SPACING = {1} mm; DIST SPACING = {2}", b1.ToString("0.00"), s1.ToString("0.00"), s2.ToString("0.00")); filFile.WriteLine("END"); filFile.Flush(); filFile.Close(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); bSuccess = false; } sw.Flush(); sw.Close(); return(bSuccess); } /**/ public void DrawSlab01(double length, double w, double mainReinforcement, double distReinforcement, double _h1, double _h2) { //length = length - 2 * h1; mainReinforcement = 180; distReinforcement = 170; h1 = _h1; h2 = _h2; length = totalLength - _h1 - _h2; document.ActiveLayOut.Entities.RemoveAll(); int distLineCount = (int)(1000 / distReinforcement); int mainLineCount = (int)(length / mainReinforcement); vdPolyline lenLineBottom = new vdPolyline(); lenLineBottom.SetUnRegisterDocument(document); lenLineBottom.setDocumentDefaults(); lenLineBottom.VertexList.Add(new VectorDraw.Geometry.gPoint(0, 0, 0)); lenLineBottom.VertexList.Add(new VectorDraw.Geometry.gPoint(0, 0, length)); lenLineBottom.VertexList.Add(new VectorDraw.Geometry.gPoint(w, 0, length)); lenLineBottom.VertexList.Add(new VectorDraw.Geometry.gPoint(w, 0, 0)); lenLineBottom.VertexList.Add(new VectorDraw.Geometry.gPoint(0, 0, 0)); document.ActiveLayOut.Entities.AddItem(lenLineBottom); vdPolyline lenLineUp = new vdPolyline(); lenLineUp.SetUnRegisterDocument(document); lenLineUp.setDocumentDefaults(); lenLineUp.VertexList.Add(new VectorDraw.Geometry.gPoint(0, D, 0)); lenLineUp.VertexList.Add(new VectorDraw.Geometry.gPoint(0, D, length)); lenLineUp.VertexList.Add(new VectorDraw.Geometry.gPoint(w, D, length)); lenLineUp.VertexList.Add(new VectorDraw.Geometry.gPoint(w, D, 0)); lenLineUp.VertexList.Add(new VectorDraw.Geometry.gPoint(0, D, 0)); document.ActiveLayOut.Entities.AddItem(lenLineUp); gPoint sPnt, ePnt; // Main Reinforcement sPnt = new gPoint(lenLineBottom.VertexList[0]); ePnt = new gPoint(lenLineBottom.VertexList[1]); //sPnt.z -= h; //ePnt.z -= h; //ePnt.y += h; //sPnt.y += h; for (int i = 0; i <= distLineCount; i++) { vdLine ln = new vdLine(); ln.SetUnRegisterDocument(document); ln.setDocumentDefaults(); //ln.StartPoint = new gPoint(sPnt); //ln.EndPoint = new gPoint(ePnt); ln.StartPoint = new gPoint(sPnt.x + h1, sPnt.y + h1, sPnt.z); ln.EndPoint = new gPoint(ePnt.x + h1, ePnt.y + h1, ePnt.z - h1); document.ActiveLayOut.Entities.AddItem(ln); sPnt.x += mainReinforcement; ePnt.x += mainReinforcement; } //Distribution Reinforcement sPnt = new gPoint(lenLineBottom.VertexList[1]); ePnt = new gPoint(lenLineBottom.VertexList[2]); for (int i = 0; i < mainLineCount; i++) { vdLine ln = new vdLine(); ln.SetUnRegisterDocument(document); ln.setDocumentDefaults(); sPnt.z -= distReinforcement; ePnt.z -= distReinforcement; ln.StartPoint = new gPoint(sPnt.x + h1, sPnt.y + h1, sPnt.z - h1); ln.EndPoint = new gPoint(ePnt.x - h1, ePnt.y + h1, ePnt.z - h1); document.ActiveLayOut.Entities.AddItem(ln); } for (int i = 1; i < lenLineBottom.VertexList.Count; i++) { vdLine ln = new vdLine(); ln.SetUnRegisterDocument(document); ln.setDocumentDefaults(); ln.StartPoint = new gPoint(lenLineBottom.VertexList[i]); ln.EndPoint = new gPoint(lenLineUp.VertexList[i]); document.ActiveLayOut.Entities.AddItem(ln); } //document.SaveAs(Path.Combine(FilePath,"SLAB01_View.dxf")); VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VTop(document); document.Redraw(true); }
public static void CmdASTRAMemberLoad(vdDocument document) { gPoint EPT, SPT; document.Prompt("Start Point:"); object ret = document.ActionUtility.getUserPoint(); document.Prompt(null); if (ret == null || !(ret is gPoint)) { return; } SPT = ret as gPoint; ActionASTRAMemberLoad aFig = new ActionASTRAMemberLoad(SPT, document.ActiveLayOut); document.Prompt("End Point :"); document.ActionAdd(aFig); StatusCode scode = aFig.WaitToFinish(); document.Prompt(null); if (scode != VectorDraw.Actions.StatusCode.Success) { return; } EPT = aFig.Value as gPoint; vdLine line1 = new vdLine(); line1.SetUnRegisterDocument(document); line1.setDocumentDefaults(); line1.StartPoint = SPT; line1.EndPoint = EPT; document.ActiveLayOut.Entities.AddItem(line1); vdLine line2 = new vdLine(); line2.SetUnRegisterDocument(document); line2.setDocumentDefaults(); line2.StartPoint = new gPoint(SPT.x, SPT.y - 1, SPT.z); line2.EndPoint = new gPoint(EPT.x, EPT.y - 1, EPT.z); document.ActiveLayOut.Entities.AddItem(line2); ASTRAMemberLoad aline = new ASTRAMemberLoad(); document.ActionLayout.Entities.AddItem(aline); document.UndoHistory.PushEnable(false); aline.InitializeProperties(); aline.setDocumentDefaults(); aline.StartPoint = line2.StartPoint; aline.EndPoint = line1.StartPoint; aline.arrowSize = 0.3; aline.Transformby(document.User2WorldMatrix); document.UndoHistory.PopEnable(); document.ActionDrawFigure(aline); double ll = ((line1.Length() / 5.0d) / line1.Length()); double sx, sy, sz; double ex, ey, ez; sx = sy = sz = 0.0d; for (int j = 1; j <= 5; j++) { ASTRAMemberLoad aline1 = new ASTRAMemberLoad(); document.ActionLayout.Entities.AddItem(aline1); document.UndoHistory.PushEnable(false); aline1.InitializeProperties(); aline1.setDocumentDefaults(); aline1.arrowSize = 0.3; sx = (j * ll) * (line2.EndPoint.x - line2.StartPoint.x) + line2.StartPoint.x; sy = (j * ll) * (line2.EndPoint.y - line2.StartPoint.y) + line2.StartPoint.y; sz = (j * ll) * (line2.EndPoint.z - line2.StartPoint.z) + line2.StartPoint.z; aline1.StartPoint = new gPoint(sx, sy, sz); ex = (j * ll) * (line1.EndPoint.x - line1.StartPoint.x) + line1.StartPoint.x; ey = (j * ll) * (line1.EndPoint.y - line1.StartPoint.y) + line1.StartPoint.y; ez = (j * ll) * (line1.EndPoint.z - line1.StartPoint.z) + line1.StartPoint.z; aline1.EndPoint = new gPoint(ex, ey, ez); aline1.Transformby(document.User2WorldMatrix); document.UndoHistory.PopEnable(); document.ActionDrawFigure(aline); } document.Redraw(true); }