private void btnOk__Click(object sender, EventArgs e) { if (this.ValidateData()) { //string PathName; Grid Grd = new Grid(); //CCfgtype cfg; CBox box = this.headsApp.ActiveDocument.BoundingBox; if (box != null) { //Delete Existing ViewerUtils.DeleteEntitiesByLabel(this.headsApp.ActiveDocument, HeadsUtils.Constants.LABEL_GRID, false); double[] xy = new double[] { box.BottomRight.X, box.BottomRight.Y, box.TopLeft.X, box.TopLeft.Y }; Grd.ModelName = "$$$$$$$$"; Grd.StringName = "****"; Grd.MinX = xy[0]; Grd.MinY = xy[1]; Grd.MaxX = xy[2]; Grd.MaxY = xy[3]; Grd.XInterval = this.tbXInterval_.Value; Grd.YInterval = this.tbYInterval_.Value; Grd.Rotation = 0; Grd.TextSize = this.tbTextSize_.Value; string FileName = Path.Combine(this.headsApp.AppDataPath, "GRID1.TMP"); BinaryWriter bw = new BinaryWriter(new FileStream(FileName, FileMode.Create), Encoding.Default); Grd.ToStream(bw); bw.Close(); FileName = Path.Combine(this.headsApp.AppDataPath, "GRID2.TMP"); ViewerUtils.DeleteFileIfExists(FileName); CCoordinatesUtil util = new CCoordinatesUtil(); util.Funcmain(this.headsApp.AppDataPath); DrawingUtil.DrawChainage(this.headsApp, FileName, HeadsUtils.Constants.LABEL_GRID, true); this.headsApp.ActiveDocument.RefreshDocument(); } this.DialogResult = DialogResult.OK; this.Close(); } }
private void ShowDetails(bool bShow) { string strHipLabel = HeadsUtils.Constants.LABEL_DETAILS + ":HIP"; ViewerUtils.DeleteEntitiesByLabel(this.m_app.ActiveDocument, strHipLabel, true); if (bShow) { double dTextHeight = 5.0; double dZVal = 5.0; double dYPos = 0; double dXPos = 0; for (int iCnt = 0; iCnt < this.dtParams.Rows.Count; iCnt++) { CHHipData hipdata = this.GetRow(iCnt); dYPos = hipdata.yvalue - (dTextHeight * 1.5); dXPos = hipdata.xvalue + 2.5; string strLine = "IP# " + iCnt.ToString(); CPoint3D pt = new CPoint3D(dXPos, dYPos, dZVal); IHdText textObj = this.m_app.ActiveDocument.DrawText(pt, strLine, dTextHeight); textObj.Label = strHipLabel; dYPos = dYPos - (dTextHeight * 1.5); strLine = "X : " + hipdata.xvalue.ToString("0.000"); pt = new CPoint3D(dXPos, dYPos, dZVal); textObj = this.m_app.ActiveDocument.DrawText(pt, strLine, dTextHeight); textObj.Label = strHipLabel; dYPos = dYPos - (dTextHeight * 1.5); strLine = "Y : " + hipdata.yvalue.ToString("0.000"); pt = new CPoint3D(dXPos, dYPos, dZVal); textObj = this.m_app.ActiveDocument.DrawText(pt, strLine, dTextHeight); textObj.Label = strHipLabel; } } this.m_app.ActiveDocument.RefreshDocument(); }
public void DeleteCoordinates(IHeadsApplication app) { ViewerUtils.DeleteEntitiesByLabel(app.ActiveDocument, HeadsUtils.Constants.LABEL_GRID, false); app.ActiveDocument.RefreshDocument(); }
public void DeleteDetails(IHeadsApplication app) { ViewerUtils.DeleteEntitiesByLabel(app.ActiveDocument, HeadsUtils.Constants.LABEL_DETAILS, false); app.ActiveDocument.RefreshDocument(); }
public void DeleteChainage(IHeadsApplication app) { ViewerUtils.DeleteEntitiesByLabel(app.ActiveDocument, HeadsUtils.Constants.LABEL_CHAINAGE, false); app.ActiveDocument.RefreshDocument(); }
public void DeleteLSecGrid(IHeadsApplication app) { ViewerUtils.DeleteEntitiesByLabel(app.ActiveDocument, HeadsUtils.Constants.LABEL_GRID + ":LSec", true); app.ActiveDocument.RefreshDocument(); }