makeRemSurface(double dblDepth) { EW_CheckSurfaceStyles.checkSurfaceStyles("EXIST"); Point3d pnt3dMove0 = Point3d.Origin; Point3d pnt3dMoveX = new Point3d(0, 0, dblDepth * -1); Matrix3d mtx3d = Matrix3d.Displacement(pnt3dMoveX - pnt3dMove0); TinSurface objSurfaceExist = Surf.getTinSurface("EXIST"); ObjectId idSurface = objSurfaceExist.copy(); using (var tr = BaseObjs.startTransactionDb()) { TinSurface surface = (TinSurface)tr.GetObject(idSurface, OpenMode.ForWrite); surface.Name = "EG-ADJ2"; Layer.manageLayers("EG-ADJ2-SURFACE"); surface.Layer = "EG-ADJ2" + "-SURFACE"; surface.TransformBy(mtx3d); surface.Rebuild(); } }
balanceSite() { double dblSiteAdjust = 0; Point3d pnt3dMove0 = Point3d.Origin; TinSurface objSurfaceSG = Surf.getTinSurface("SG", out exists); TinSurface objSurfaceOX = Surf.getTinSurface("OX", out exists); dblSiteAdjust = double.Parse(this.tboxAdjSurface.Text); varDataCurrent.SITE_ADJUST = dblSiteAdjust; updateDictionary(varDataCurrent); Point3d pnt3dMoveX = new Point3d(0, 0, dblSiteAdjust); Matrix3d mtx3d = Matrix3d.Displacement(pnt3dMoveX - pnt3dMove0); objSurfaceSG.TransformBy(mtx3d); objSurfaceOX.TransformBy(mtx3d); ewtbe.reTest(); ewmsv.updateVolSurface("EXIST", "BOT"); ewmsv.updateVolSurface("BOT", "SG"); // ERROR: Not supported in C#: OnErrorStatement ObjectId idSurfaceCUT = Surf.getSurface("VOL_EXIST_BOT", out exists); if (idSurfaceCUT.IsNull) { ewmsv.updateVolSurface("EXIST", "BOT"); } ObjectId idSurfaceFILL = Surf.getSurface("VOL_BOT_SG", out exists); if (idSurfaceFILL.IsNull) { ewmsv.updateVolSurface("BOT", "SG"); } TinVolumeSurface objSurfaceCUT = (TinVolumeSurface)idSurfaceCUT.getEnt(); dblVOL_EXIST_BOT_CUT = objSurfaceCUT.GetVolumeProperties().UnadjustedCutVolume / 27; dblVOL_EXIST_BOT_FILL = objSurfaceCUT.GetVolumeProperties().UnadjustedFillVolume / 27; TinVolumeSurface objSurfaceFILL = (TinVolumeSurface)idSurfaceFILL.getEnt(); dblVOL_BOT_SG_CUT = objSurfaceFILL.GetVolumeProperties().UnadjustedCutVolume / 27; dblVOL_BOT_SG_FILL = objSurfaceFILL.GetVolumeProperties().UnadjustedFillVolume / 27; dblVOL_CUT_TOT = dblVOL_EXIST_BOT_CUT + dblVOL_BOT_SG_CUT; //Gross Cut put in spreadsheet dblVOL_FILL_TOT = dblVOL_EXIST_BOT_FILL + dblVOL_BOT_SG_FILL; //Gross Fill put in spreadsheet dblVOL_CUT_SHRINK = (dblVOL_CUT_TOT * dblSHRINKAGE_FACTOR * -1); dblVOL_CUT_NET = dblVOL_CUT_ADJ_NET + dblVOL_CUT_TOT + dblVOL_CUT_SHRINK; dblVOL_FILL_NET = dblVOL_FILL_ADJ_NET + dblVOL_FILL_TOT; dblSG_MEAN_ELEV = objSurfaceSG.GetGeneralProperties().MeanElevation; dblVOL_NET = (dblVOL_CUT_NET - dblVOL_FILL_NET); dblSITE_ADJUST = dblVOL_NET * 27 / dblAREA_SITE; this.AdjustSurfaceSG.Text = string.Format("{0:#0.00", dblSG_MEAN_ELEV - dblSG_MEAN_ELEV0); varDataCurrent.ITERATION = "C"; varDataCurrent.DATE = strDATE; varDataCurrent.USER = strUSER; varDataCurrent.AREA_SITE = dblAREA_SITE; varDataCurrent.SG_MEAN_ELEV = dblSG_MEAN_ELEV; varDataCurrent.VOL_CUT_TOT = dblVOL_CUT_TOT; varDataCurrent.VOL_CUT_ADJ_NET = dblVOL_CUT_ADJ_NET; varDataCurrent.VOL_CUT_SHRINK = dblVOL_CUT_SHRINK; varDataCurrent.VOL_CUT_NET = dblVOL_CUT_NET; varDataCurrent.VOL_FILL_TOT = dblVOL_FILL_TOT; varDataCurrent.VOL_FILL_ADJ_NET = dblVOL_FILL_ADJ_NET; varDataCurrent.VOL_FILL_NET = dblVOL_FILL_NET; varDataCurrent.VOL_NET = dblVOL_NET; varDataCurrent.SITE_ADJUST = dblSITE_ADJUST; ewData = getDictData(); ewData.Add(varDataCurrent); this.DG1.DataContext = ewData; return; }