Adds boundaries to the surface from a collection of entity ObjectIds.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.4.2516.0
Syntax
C# |
---|
public SurfaceOperationAddBoundary AddBoundaries( ObjectIdCollection boundaryEntities, double midOrdinateDistance, SurfaceBoundaryType boundaryType, bool useNonDestructiveBreakline ) |
Visual Basic |
---|
Public Function AddBoundaries ( _ boundaryEntities As ObjectIdCollection, _ midOrdinateDistance As Double, _ boundaryType As SurfaceBoundaryType, _ useNonDestructiveBreakline As Boolean _ ) As SurfaceOperationAddBoundary |
Visual C++ |
---|
public: SurfaceOperationAddBoundary^ AddBoundaries( ObjectIdCollection^ boundaryEntities, double midOrdinateDistance, SurfaceBoundaryType boundaryType, bool useNonDestructiveBreakline ) |
Parameters
- boundaryEntities
- Type: ObjectIdCollection
A collection that contains the ObjectIds of entities used to define the surface boundaries.
- midOrdinateDistance
- Type: System..::..Double
When the boundary is defined from a polyline with curves, the midOrdinateDistance value is used to tessellate the arc segments of the boundary.
- boundaryType
- Type: Autodesk.Civil..::..SurfaceBoundaryType
Specifies the surface boundary type.
- useNonDestructiveBreakline
- Type: System..::..Boolean
Spefifies whether to use non-destructive breaklines when the boundary is created.
Remarks
- The parameter useNonDestructiveBreakline is ignored for a GridVolumeSurface or TinSurface with a DataClip boundary type.
- When creating the DataClip/Outer boundary, the first ObjectId in boundaryEntities is used, and any other ObjectIds in the collection are ignored.
- The first boundary in the boundaryEntities should be closed when creating a DataClip boundary.
Examples

1// Setup: create and populate a surface with 100 random points: 2ObjectId surfaceId = TinSurface.Create(_acaddoc.Database, "Example Surface"); 3TinSurface surface = surfaceId.GetObject(OpenMode.ForWrite) as TinSurface; 4Point3dGenerator p3dgen = new Point3dGenerator(); 5Point3dCollection locations = p3dgen.AsPoint3dCollection(); 6surface.AddVertices(locations); 7 8SurfaceDefinitionBoundaries surfaceBoundaries = surface.BoundariesDefinition; 9write(String.Format("Existing surface boundary definitions: {0} \n", surfaceBoundaries.Count)); 10 11// Define a polygon with 2d points to use as a boundary 12// 13Point2dCollection point2dBoundary = new Point2dCollection(); 14point2dBoundary.Add(new Point2d(10, 10)); 15point2dBoundary.Add(new Point2d(10, 90)); 16point2dBoundary.Add(new Point2d(90, 90)); 17point2dBoundary.Add(new Point2d(90, 10)); 18// point2dBoundary.Add(new Point2d(10, 10)); // required for SurfaceBoundaryType.DataClip 19 20surfaceBoundaries.AddBoundaries(point2dBoundary, 1.0, SurfaceBoundaryType.Outer, true); 21 22// Define a polygon with 3d points to use as a boundary 23// 24Point3dCollection point3dBoundary = new Point3dCollection(); 25point3dBoundary.Add(new Point3d(20, 20, 0)); 26point3dBoundary.Add(new Point3d(20, 30, 0)); 27point3dBoundary.Add(new Point3d(30, 30, 0)); 28point3dBoundary.Add(new Point3d(30, 20, 0)); 29// point3dBoundary.Add(new Point3d(20, 20, 0)); // required for SurfaceBoundaryType.DataClip 30surfaceBoundaries.AddBoundaries(point3dBoundary, 1.0, SurfaceBoundaryType.Hide, true); 31 32// Define a polygon to use as a boundary 33// 34Database acadDb = _acaddoc.Database; 35BlockTable blockTable = tr.GetObject(acadDb.BlockTableId, OpenMode.ForRead) as BlockTable; 36BlockTableRecord blockTableRec = tr.GetObject(blockTable[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord; 37 38Polyline polyline = new Polyline(); 39polyline.SetDatabaseDefaults(); 40polyline.AddVertexAt(0, new Point2d(70, 70), 0, 0, 0); 41polyline.AddVertexAt(1, new Point2d(70, 110), 0, 0, 0); 42polyline.AddVertexAt(2, new Point2d(110, 110), 0, 0, 0); 43polyline.AddVertexAt(3, new Point2d(110, 70), 0, 0, 0); 44polyline.Closed = true; 45blockTableRec.AppendEntity(polyline); 46tr.AddNewlyCreatedDBObject(polyline, true); 47 48// Add the polyline's ObjectId to a collection 49ObjectIdCollection verticeIds = new ObjectIdCollection(); 50verticeIds.Add(polyline.ObjectId); 51 52surfaceBoundaries.AddBoundaries(verticeIds, 1.0, SurfaceBoundaryType.Show, true); 53 54surface.Rebuild();

1' Setup: create and populate a surface with 100 random points: 2Dim surfaceId As ObjectId = TinSurface.Create(_acaddoc.Database, "Example Surface") 3Dim surface As TinSurface = TryCast(surfaceId.GetObject(OpenMode.ForWrite), TinSurface) 4Dim p3dgen As New Point3dGenerator() 5Dim locations As Point3dCollection = p3dgen.AsPoint3dCollection() 6surface.AddVertices(locations) 7 8Dim surfaceBoundaries As SurfaceDefinitionBoundaries = surface.BoundariesDefinition 9write([String].Format("Existing surface boundary definitions: {0} " & vbLf, surfaceBoundaries.Count)) 10 11' Define a polygon with 2d points to use as a boundary 12' 13Dim point2dBoundary As New Point2dCollection() 14point2dBoundary.Add(New Point2d(10, 10)) 15point2dBoundary.Add(New Point2d(10, 90)) 16point2dBoundary.Add(New Point2d(90, 90)) 17point2dBoundary.Add(New Point2d(90, 10)) 18' point2dBoundary.Add(new Point2d(10, 10)); // required for SurfaceBoundaryType.DataClip 19 20 21surfaceBoundaries.AddBoundaries(point2dBoundary, 1.0, SurfaceBoundaryType.Outer, True) 22 23' Define a polygon with 3d points to use as a boundary 24' 25Dim point3dBoundary As New Point3dCollection() 26point3dBoundary.Add(New Point3d(20, 20, 0)) 27point3dBoundary.Add(New Point3d(20, 30, 0)) 28point3dBoundary.Add(New Point3d(30, 30, 0)) 29point3dBoundary.Add(New Point3d(30, 20, 0)) 30' point3dBoundary.Add(new Point3d(20, 20, 0)); // required for SurfaceBoundaryType.DataClip 31surfaceBoundaries.AddBoundaries(point3dBoundary, 1.0, SurfaceBoundaryType.Hide, True) 32 33' Define a polygon to use as a boundary 34' 35Dim acadDb As Database = _acaddoc.Database 36Dim blockTable As BlockTable = TryCast(tr.GetObject(acadDb.BlockTableId, OpenMode.ForRead), BlockTable) 37Dim blockTableRec As BlockTableRecord = TryCast(tr.GetObject(blockTable(BlockTableRecord.ModelSpace), OpenMode.ForWrite), BlockTableRecord) 38 39Dim polyline As New Polyline() 40polyline.SetDatabaseDefaults() 41polyline.AddVertexAt(0, New Point2d(70, 70), 0, 0, 0) 42polyline.AddVertexAt(1, New Point2d(70, 110), 0, 0, 0) 43polyline.AddVertexAt(2, New Point2d(110, 110), 0, 0, 0) 44polyline.AddVertexAt(3, New Point2d(110, 70), 0, 0, 0) 45polyline.Closed = True 46blockTableRec.AppendEntity(polyline) 47tr.AddNewlyCreatedDBObject(polyline, True) 48 49' Add the polyline's ObjectId to a collection 50Dim verticeIds As New ObjectIdCollection() 51verticeIds.Add(polyline.ObjectId) 52 53surfaceBoundaries.AddBoundaries(verticeIds, 1.0, SurfaceBoundaryType.Show, True)
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentException |
Thrown when:
|
System..::..InvalidOperationException | Thrown when boundaryType is DataClip, and the SurfaceDefinitionBoundaries is obtained from a GridVolumeSurface or TinVolumeSurface. |