Share

SurfaceOperationSmooth Class

This class encapsulates the operation of smoothing a TinSurface object.

Inheritance Hierarchy

SystemObject
  Autodesk.Civil.DatabaseServicesSurfaceOperation
    Autodesk.Civil.DatabaseServicesSurfaceOperationSmooth


Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.280

Syntax

C#

public class SurfaceOperationSmooth : SurfaceOperation

VB

Public Class SurfaceOperationSmooth
	Inherits SurfaceOperation

C++

public ref class SurfaceOperationSmooth : public SurfaceOperation

The SurfaceOperationSmooth type exposes the following members.

Properties

 NameDescription
Public propertyEnabled Gets or sets whether this operation is included when the surface is built.
(Inherited from SurfaceOperation)
Public propertyOutPutPoints Gets the output points for the current smoothing operation.
Public propertySurfaceSmoothMethod Gets the type of surface smoothing for the current operation.

Methods

 NameDescription
Public methodDispose
(Inherited from SurfaceOperation)
Public methodMoveDown Moves the operation one position down in the operation list.
(Inherited from SurfaceOperation)
Public methodMoveToBottom Moves the operation to the bottom of the operation list.
(Inherited from SurfaceOperation)
Public methodMoveToTop Moves the operation to the top of the operation list.
(Inherited from SurfaceOperation)
Public methodMoveUp Moves the operation one position up in the operation list.
(Inherited from SurfaceOperation)

Example

 1/// <summary>
 2/// Illustrates Smoothing a TIN Surface
 3/// </summary>
 4[CommandMethod("SmoothTinSurface")]
 5public void SmoothTinSurface()
 6{
 7    using (Transaction ts = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction())
 8    {
 9        try
10        {
11            // Select a TIN Surface:     
12            ObjectId surfaceId = promptForEntity("Select a TIN surface to smooth\n", typeof(TinSurface));
13            TinSurface oSurface = surfaceId.GetObject(OpenMode.ForWrite) as TinSurface;
14
15            // Select a polyline to define the output region:
16            ObjectId polylineId = promptForEntity("Select a polyline to define the output region\n", typeof(Polyline));
17            Point3dCollection points = new Point3dCollection();
18            Polyline polyline = polylineId.GetObject(OpenMode.ForRead) as Polyline;
19
20            // Convert the polyline into a collection of points:
21            int count = polyline.NumberOfVertices;
22            for (int i = 0; i < count; i++)
23            {
24                points.Add(polyline.GetPoint3dAt(i));
25            }
26
27            // Set the options:
28            SurfacePointOutputOptions output = new SurfacePointOutputOptions();
29            output.OutputLocations = SurfacePointOutputLocationsType.Centroids;
30            output.OutputRegions = new Point3dCollection[] { points };
31
32            SurfaceOperationSmooth op = oSurface.SmoothSurfaceByNNI(output);
33
34            editor.WriteMessage("Output Points: {0}\n", op.OutPutPoints.Count);
35
36            // Commit the transaction
37            ts.Commit();
38        }
39        catch (System.Exception e) { editor.WriteMessage(e.Message); }
40    }
41}

See Also

Reference

Was this information helpful?