.NET

Reply
Member
4 Posts
0 Kudos
Registered: ‎07-23-2012
Post 1 of 3

Error when slicing a Solid3D

195 Views, 2 Replies
07-23-2012 01:32 AM

Hello all,

 

i am quite new to AutoCAD 2010 .net development using C# and got a problem i can´t understand.


After cutting some Solid3Ds AutoCAD suddenly crashes. Sometimes the "Send Error Report" Dialog opens, sometimes AutoCAD just disappears, sometimes it asks me if i want to save my changes.
Checked everything for memory leaks, looked at the debug output and there are no leaks at all.

 

Currently i cut along a PlaneSurface that is defined as follows:

            Polyline acPolyline;
            acPolyline = new Polyline();
            acPolyline.SetDatabaseDefaults();
            acPolyline.AddVertexAt(0, new Point2d(0, 0), 0, 0, 0);
            acPolyline.AddVertexAt(1, new Point2d(-profile.Width, 0), 0, 0, 0);
            acPolyline.AddVertexAt(2, new Point2d(-profile.Width, profile.Height), 0, 0, 0);
            acPolyline.AddVertexAt(3, new Point2d(0, profile.Height), 0, 0, 0);
            acPolyline.Closed = true;
            acPolyline.Normal = profile.Axis.Direction;
            TransformPolyline(ref acPolyline, profile);

            Region acPlaneRegion = GetRegionFromPolyline(acPolyline);
            acPolyline.Dispose();
            acPolyline = null;
            acPlaneRegion.TransformBy(Matrix3d.Rotation(Utilities.Math.DegreeToRadian(90), new Vector3d(1, 0, 0), new Point3d(0, 0, 0)));
            //acPlaneRegion.TransformBy(Matrix3d.Rotation(Utilities.Math.DegreeToRadian(-cuttingAngle), new Vector3d(0, 0, 1), new Point3d(0, 0, 0)))
            acPlaneRegion.TransformBy(Matrix3d.Displacement(axisPoint.GetAsVector()));

            PlaneSurface acPlaneSurface = new PlaneSurface();
            acPlaneSurface.CreateFromRegion(acPlaneRegion);

 

When transmitting the PlaneSurface via the Transaction it looks fine too.

And here is how i cut with the PlaneSurface:

miterCuttingPlanes = GetMiterCuttingPlanes(profile); 

                        acSolidPart1 = acSolid.Slice(miterCuttingPlanes.PlaneCut1Out, true);

                        if (acSolidPart1 != null)
                        {
                            if (profile.Cut1Out >= 90)
                            {
                                acSlicedSolid = acSolidPart1;
                                acSolid.Dispose();
                            }
                            else
                            {
                                acSlicedSolid = acSolid;
                                acSolidPart1.Dispose();
                            }
                        }

 

 The acSolid is created by simply extruding a region along a path.

As is said before AutoCAD sometimes simply crashes/disappears when executing this. Anyone has any ideas on why this is happening? 

 

ADN Support Specialist
762 Posts
100 Kudos
Registered: ‎03-21-2011
Post 2 of 3

Re: Error when slicing a Solid3D

07-30-2012 05:26 AM in reply to: OrgadataPST

Hello,

 

It is quite hard to say what might be causing the crash. Can you please share a minimal buildable sample project that I can use to reproduce the error ?

 

Thank you.



Balaji
Developer Technical Services
Autodesk Developer Network

ADN Support Specialist
352 Posts
27 Kudos
Registered: ‎07-24-2007
Post 3 of 3

Re: Error when slicing a Solid3D

07-30-2012 04:34 PM in reply to: OrgadataPST

Please see my post here http://forums.autodesk.com/t5/NET/Crash-when-Transaction-takes-too-long/m-p/3558582/highlight/false#...





Fenton Webb

Developer Technical Services

Autodesk Developer Network


Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!