.NET

Reply
Member
OrgadataPST
Posts: 4
Registered: ‎07-23-2012
Message 1 of 3 (189 Views)

Error when slicing a Solid3D

189 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
Balaji_Ram
Posts: 715
Registered: ‎03-21-2011
Message 2 of 3 (112 Views)

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
fenton.webb
Posts: 352
Registered: ‎07-24-2007
Message 3 of 3 (103 Views)

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
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.