Creates a snapshot that contains the current state of points and triangles resulting from previous Surface operations. A snapshot can improve the performance of Surface builds from subsequent operations.

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

Syntax

C#
public void CreateSnapshot()
Visual Basic
Public Sub CreateSnapshot
Visual C++
public:
void CreateSnapshot()

Remarks

  1. You can create only one snapshot for each Surface.
  2. When a surface is built, previous surface operations are ignored and the surface build begins at the snapshot operation.

Examples

CopyC#
 1/// <summary>
 2/// Illustrates using surface snapshots
 3/// </summary>
 4[CommandMethod("SurfaceIntersect")]
 5public void SurfaceIntersect()
 6{
 7    using (Transaction ts = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction())
 8    {
 9        // get the first surface in the document
10        ObjectId surfaceId = doc.GetSurfaceIds()[0];
11        TinSurface oSurface = surfaceId.GetObject(OpenMode.ForRead) as TinSurface;
12
13        try
14        {
15            if (oSurface.HasSnapshot)
16            {
17                oSurface.RemoveSnapshot();
18            }
19            oSurface.CreateSnapshot();
20            oSurface.RebuildSnapshot();
21        }
22
23        catch (System.Exception e)
24        {
25            editor.WriteMessage("Snapshot Operation Failed: {0}", e.Message);
26        }
27
28        // commit the transaction
29        ts.Commit();
30    }
31}

See Also