Getting all points from Solid3D by using Brep randomly crashes AutoCAD with large objects
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
please is anybody able to help us? We are struggling with critical AutoCAD crashing problem.
Visual Studio debugger shows an error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt" in RXObject.DeleteUnmanagedObject()
public static List<Point2d> GetPointsFromSolid3d(Solid3d ent, Transaction tr)
{
List<Point2d> points = new List<Point2d>();
using (Autodesk.AutoCAD.BoundaryRepresentation.Brep brp = new Autodesk.AutoCAD.BoundaryRepresentation.Brep(ent))
{
foreach (var v in brp.Vertices)
{
Point2d p2d = v.Point.GetPoint2D();
if (!points.Contains(p2d))
points.Add(p2d);
}
GC.Collect();
GC.WaitForPendingFinalizers();
}
return points;
}
Is there another workaround, how to avoid random AutoCAD crashes? The purpose of this code is to get points for Civil 3D alignment station, 2D/3D area of solids and other important take-off parameters...
Thanks
Martin