Seperating AutoCAD surfaces with two seperate entities in one object
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm currently working on a .net project related to slicing surfaces based on several boundaries. However, i've encountered a problem with this challenge. The problem occurs when a autocad surface is sliced in the middle, and a new surface with two or more seperate bodies is created, as seen in the image below. Slicing this outside surface then results in an eNoIntersections error. Hence, it is needed to seperate the outside surface into two seperate entities . Then only the surface that intersects with the boundary can be selected an no error should occur.
The code snippet (VB.NET) that currently performs the task of slicing the surface is attached below:
Dim surfaceInsideBounds = DirectCast(sliceObject, Autodesk.AutoCAD.DatabaseServices.Surface)
Dim sliceResults As SurfaceSliceResults = surfaceInsideBounds.SliceBySurface(SweptSurface)
Dim surfaceOutsideBounds As Autodesk.AutoCAD.DatabaseServices.Surface = sliceResults.NegativeHalfSurface
surfaceOutsideBounds.SetDatabaseDefaults()
surfaceOutsideBounds.Layer = sliceObject.Layer
surfaceOutsideBounds.Color = sliceObject.Color
btr.AppendEntity(surfaceOutsideBounds)
trans2.AddNewlyCreatedDBObject(surfaceOutsideBounds, True)The surface inside the boundary and outside the boundary needs to be preserved in this process.
I'm looking for a similar method as described in Separate Solid Complexes into Separate Solids - AutoCAD DevBlog
with solid.SeparateBody(), but then for AutoCAD Surfaces. Can anyone provide some help?
With kind regards,
Stan Bouwens