public void ZoomTo() { string SPoint = TxbUS_OBJECT_ID.Text.Trim(); string EPoint = TxbDS_OBJECT_ID.Text.Trim(); if (SPoint == string.Empty || EPoint == string.Empty) { return; } Point3d S_P = GetPointByID(SPoint); Point3d E_P = GetPointByID(EPoint); if (S_P.X == 0 || S_P.Y == 0) { throw new Exception("起点不存在"); //MessageBox.Show("起点不存在"); //return; } if (E_P.X == 0 || E_P.Y == 0) { throw new Exception("终点不存在"); //MessageBox.Show("终点不存在"); //return; } if (S_P.X != 0 && S_P.Y != 0 && E_P.X != 0 && E_P.Y != 0) { Point3d Mid_P = new Point3d((S_P.X + E_P.X) / 2, (S_P.Y + E_P.Y) / 2, 0); // ZoomPoint.Zoom(S_P, E_P,new Point3d(), 5); ZoomPoint.DrawCircle(Mid_P); Zoom(Mid_P); } }
private void btnPickCoord_Click(object sender, EventArgs e) { Point3d pPoint3d = PickObject(); TxbCo_X.Text = pPoint3d.X.ToString(); TxbCO_Y.Text = pPoint3d.Y.ToString(); ZoomPoint.DrawCircle(pPoint3d); }
private void Zoom(Point3d CurPoint) { Point3d pMin = new Point3d(CurPoint.X - 10, CurPoint.Y + 5, 0); Point3d pMax = new Point3d(CurPoint.X + 10, CurPoint.Y, 0); Point3d pPoint3D = new Point3d(CurPoint.X, CurPoint.Y, 0); ZoomPoint.DrawCircle(pPoint3D); ZoomPoint.Zoom(pMin, pMax, new Point3d(), 5); }
private void BtnPickCoord_Click(object sender, EventArgs e) { Point3d pPoint3d = PickPoint(); TxbCo_X.Text = pPoint3d.X.ToString("0.00"); TxbCO_Y.Text = pPoint3d.Y.ToString("0.00"); ZoomPoint.DrawCircle(pPoint3d); AlterCoord = true; }
private void ZoomByPointID(string PointID) { Point3d pPoint = GetPointByID(PointID); if (pPoint.X == 0 || pPoint.Y == 0) { MessageBox.Show("该点号不存在"); return; } ZoomPoint.DrawCircle(pPoint); Zoom(pPoint); }
private void superGridControlCoords_CellDoubleClick(object sender, DevComponents.DotNetBar.SuperGrid.GridCellDoubleClickEventArgs e) { DevComponents.DotNetBar.SuperGrid.GridRow pGridRow = e.GridCell.GridRow; if (pGridRow == null) { return; } int pPointY = Convert.ToInt32(Convert.ToDouble(pGridRow[1].Value.ToString())); int pPointX = Convert.ToInt32(Convert.ToDouble(pGridRow[2].Value.ToString())); Point3d pMin = new Point3d(pPointX - 10, pPointY + 5, 0); Point3d pMax = new Point3d(pPointX + 10, pPointY, 0); ZoomPoint.Zoom(pMin, pMax, new Point3d(), 1); DrawCircle(new Point3d(double.Parse(pGridRow[2].Value.ToString()), double.Parse(pGridRow[1].Value.ToString()), 0)); AcadDocument AcadDoc = AcadApp.ActiveDocument; Microsoft.VisualBasic.Interaction.AppActivate(AcadApp.Caption); }