.NET
cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 

Error when slicing a Solid3D

2 REPLIES 2
Reply
Message 1 of 3
OrgadataPST
563 Views, 2 Replies

Error when slicing a Solid3D

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? 

 

2 REPLIES 2
Message 2 of 3
Balaji_Ram
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

Message 3 of 3
fenton.webb
in reply to: OrgadataPST

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

ā€Boost