private void drawLine(ref Point3d point, View view, MsdDrawingMode drawMode) { this.segmentPoints[1] = point; Element line = app.CreateLineElement1(null, ref this.segmentPoints); line.Redraw(drawMode); }
/// Called by the state machine for each mouse move event. /// point: Current cursor location. /// view: Cursor is in this view. /// drawMode: Draw mode supplied by the drawing engine. public void Dynamics(ref Point3d Point, BCOM.View View, MsdDrawingMode DrawMode) { if (m_nPoints != 1) { return; } string[] txtStr = new string[2]; Point3d[] txtPts = new Point3d[2]; Element[] elems = new Element[3]; m_atPoints[1] = Point; txtStr[0] = (myForm.rbEN.Checked ? "E=" : "X=") + m_atPoints[0].X.ToString("F2"); txtStr[1] = (myForm.rbEN.Checked ? "N=" : "Y=") + m_atPoints[0].Y.ToString("F2"); double txtLen = app.ActiveSettings.TextStyle.Width * Math.Max(txtStr[0].Length, txtStr[1].Length); double txtLineSpacing = app.ActiveSettings.TextStyle.Height; if (myForm.rbHorizontal.Checked) { m_atPoints[2].X = m_atPoints[1].X + (m_atPoints[0].X > m_atPoints[1].X ? -txtLen : txtLen) * 1.2; m_atPoints[2].Y = m_atPoints[1].Y; txtPts[0].X = (m_atPoints[1].X + m_atPoints[2].X) / 2; txtPts[0].Y = m_atPoints[1].Y + txtLineSpacing; txtPts[1].X = txtPts[0].X; txtPts[1].Y = m_atPoints[1].Y - txtLineSpacing; } else { m_atPoints[2].X = m_atPoints[1].X; m_atPoints[2].Y = m_atPoints[1].Y + (m_atPoints[0].Y > m_atPoints[1].Y ? -txtLen : txtLen) * 1.2; txtPts[0].X = m_atPoints[1].X - txtLineSpacing; txtPts[0].Y = (m_atPoints[1].Y + m_atPoints[2].Y) / 2; txtPts[1].X = m_atPoints[1].X + txtLineSpacing; txtPts[1].Y = txtPts[0].Y; } elems[0] = app.CreateLineElement1(null, ref m_atPoints); elems[0].LineStyle = app.ActiveDesignFile.LineStyles.Find("0", null); Matrix3d rMatrix = app.Matrix3dIdentity(); for (int i = 1; i < 3; i++) { elems[i] = app.CreateTextElement1(null, txtStr[i - 1], ref txtPts[i - 1], ref rMatrix); elems[i].AsTextElement().TextStyle.Font = app.ActiveDesignFile.Fonts.Find(MsdFontType.MicroStation, "ENGINEERING", null); elems[i].AsTextElement().TextStyle.Justification = MsdTextJustification.CenterCenter; if (myForm.rbVertical.Checked) { elems[i].RotateAboutZ(ref txtPts[i - 1], Math.PI / 2); } } CellElement elemCell = app.CreateCellElement1("NoteCoordCell", ref elems, ref m_atPoints[0], false); elemCell.Redraw(DrawMode); if (MsdDrawingMode.Normal == DrawMode) { app.ActiveModelReference.AddElement(elemCell); } }
public void Dynamics(ref Point3d Point, View View, MsdDrawingMode DrawMode) { if (userClicked == 0) { return; } linestringPoints[userClicked] = Point; Element elem = app.CreateLineElement1(null, ref linestringPoints); elem.Redraw(DrawMode); }
public void Dynamics(ref Point3d Point, View View, MsdDrawingMode DrawMode) { if (this.clickCounter == 0) { string cellText = String.IsNullOrEmpty(inputForm.tbStart.Text) ? "start" : inputForm.tbStart.Text; drawCell(ref Point, View, DrawMode, cellText); } if (this.clickCounter == 1) { drawLine(ref Point, View, DrawMode); } }
public void Dynamics(ref Point3d Point, View View, MsdDrawingMode DrawMode) { if (!ready) { Element label = create_rebar_label(content); Range3d label_range = label.Range; Point3d down_left = label_range.Low, up_right = label_range.High; double line_length = up_right.Y - down_left.Y; Element line = create_line(line_length); label.Move(ref Point); line.Move(ref Point); List <Element> list = new List <Element>(); list.Add(label); list.Add(line); CellElement cell = app.CreateCellElement1("标签", list.ToArray(), Point); cell.Redraw(DrawMode); } else { if (current_point.X != Point.X) { Point.X = current_point.X; } Element guide_line = create_line(current_point, Point); Element label = create_rebar_label(content); Range3d label_range = label.Range; Point3d down_left = label_range.Low, up_right = label_range.High; double line_length = up_right.Y - down_left.Y; Element line = create_line(line_length); if (current_point.Y < Point.Y) { Point.Y = Point.Y + line_length; } label.Move(Point); line.Move(Point); List <Element> list = new List <Element>(); list.Add(label); list.Add(line); list.Add(guide_line); CellElement cell = app.CreateCellElement1("标签1", list.ToArray(), Point); cell.Redraw(DrawMode); } }
public void Dynamics(ref Point3d Point, View View, MsdDrawingMode DrawMode) { }
public void Dynamics(ref Point3d Point, Bentley.Interop.MicroStationDGN.View View, MsdDrawingMode DrawMode) { Element column = null, foundation = null; stirrupData = read_Data(); switch (stf.Type) { case TYPE.TYPE1: { StirrupData1 data = (StirrupData1)stirrupData; column = RCUtil.create_column(data.B, data.H, 1500, 400); foundation = RCUtil.create_foundation(1500, 1500, 400); break; } case TYPE.TYPE2: { StirrupData2 data = (StirrupData2)stirrupData; column = RCUtil.create_column(data.B, data.H, 1500, 400); foundation = RCUtil.create_foundation(1500, 1500, 400); break; } case TYPE.TYPE3: { StirrupData3 data = (StirrupData3)stirrupData; column = RCUtil.create_column(data.B, data.H, 1500, 400); foundation = RCUtil.create_foundation(1500, 1500, 400); break; } case TYPE.TYPE4: { StirrupData4 data = (StirrupData4)stirrupData; column = RCUtil.create_column(data.B, data.H, 1500, 400); foundation = RCUtil.create_foundation(1500, 1500, 400); break; } case TYPE.TYPE5: { StirrupData5 data = (StirrupData5)stirrupData; column = RCUtil.create_column(data.B, data.H, 1500, 400); foundation = RCUtil.create_foundation(1500, 1500, 400); break; } case TYPE.TYPE6: { StirrupData6 data = (StirrupData6)stirrupData; column = RCUtil.create_column(data.D, 1500, 400); foundation = RCUtil.create_foundation(1500, 1500, 400); break; } case TYPE.TYPE7: { StirrupData7 data = (StirrupData7)stirrupData; column = RCUtil.create_column(data.D, 1500, 400); foundation = RCUtil.create_foundation(1500, 1500, 400); break; } } //动态移动的时候不显示配筋,只有点击的时候才画配筋 column.Move(ref Point); foundation.Move(ref Point); //必须redraw,否侧元素不显示 column.Redraw(DrawMode); foundation.Redraw(DrawMode); }
private void drawCell(ref Point3d point, View view, MsdDrawingMode drawMode, string text) { TextElement textElem = makeTextElement(ref point, view, text); textElem.Redraw(drawMode); }
public void Dynamics(ref Point3d point, View view, MsdDrawingMode drawMode) { app.ShowError("Dynamics()"); }