Message 1 of 2
"IllegalBoundary" and "Failure" Error When Adding Boundary to TIN Surface in Civil 3D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm having trouble adding a boundary to a TIN Surface using the Civil 3D API. When calling TinSurface.BoundariesDefinition.AddBoundaries(), I get the error "Autodesk.Civil.SurfaceException: Failure (IllegalBoundary)". I'd like to know how to check if a boundary is valid before adding it and if there's a way to clear old or invalid boundaries. My engineering knowledge is limited, so any explanation about the possible causes of this error would be very helpful.
foreach (var quadPoly in listPoly)
{
quadPoly.AddToDocument(modelSpace, acT);
var ApplyOverkill = AutoCadUtils.EditorCommand([quadPoly.Id], "-OVERKILL", ed);
TinSurface quadSurf1 = TinSurface
.Create(acDb, $"QuadSurf1_{x}_{y}")
.GetObjectForWrite<TinSurface>(acT);
quadSurf1.PasteSurface(surf1.Id);
try
{
quadSurf1.BoundariesDefinition.AddBoundaries(
new ObjectIdCollection { quadPoly.Id },
1,
Autodesk.Civil.SurfaceBoundaryType.Outer,
true);
quadSurf1.Rebuild();
var info = quadSurf1.GetArea();
}
catch (Exception ex) when (
ex is SurfaceException ||
ex is System.Runtime.InteropServices.SEHException)
{}
catch (Exception ex)
{}
}