/// <summary> /// Sets the smoothing to 0.5 ft for select surfaces /// </summary> /// <param name="surface">The surface.</param> /// <param name="points">The points.</param> /// <returns>TinSurface.</returns> public TinSurface SetSmoothing(TinSurface surface, Point3dCollection points) { try { PGA.MessengerManager.MessengerManager.AddLog("Start Smoothing for " + surface.Name); //Smooth Critical Surfaces// if (surface.Name.Contains("GREEN") || surface.Name.Contains("COLLAR") || surface.Name.Contains("BUNKER") || surface.Name.Contains("BRIDGE")) { using (Transaction ts = CivilApplicationManager.StartTransaction()) { //try //{ // if (!surface.IsWriteEnabled) // surface.UpgradeOpen(); //} //catch (System.Exception ex) //{ // MessengerManager.AddLog("Open for Write Failed: " + surface.Name); //} SurfacePointOutputOptions pointOutputOptions = new SurfacePointOutputOptions(); pointOutputOptions.GridSpacingX = 0.5; pointOutputOptions.GridSpacingY = 0.5; pointOutputOptions.OutputLocations = SurfacePointOutputLocationsType.GridBased; pointOutputOptions.OutputRegions = new Point3dCollection[] { points }; SurfaceOperationSmooth op = surface.SmoothSurfaceByNNI(pointOutputOptions); ts.Commit(); } PGA.MessengerManager.MessengerManager.AddLog("End Smoothing for " + surface.Name); } return(surface); } catch (System.Exception ex) { PGA.MessengerManager.MessengerManager.LogException(ex); } return(null); }