Assertion Failed

Assertion Failed

Anonymous
Not applicable
4,945 Views
6 Replies
Message 1 of 7

Assertion Failed

Anonymous
Not applicable

I get an "Assertion Failed" Exception Dialog when using the Pointmonitor Event. The line of code that it shows me is

 

Autodesk.AutoCAD.DatabaseServices.FullSubentityPath[] entPaths = e.Context.GetPickedEntities();

 From my online research it has pointed to some debug code left in that is failing within that method call.

0 Likes
Accepted solutions (1)
4,946 Views
6 Replies
Replies (6)
Message 2 of 7

gopinath.taget
Alumni
Alumni

This is not enough information to determine what is going wrong. Do you get an AutoCAD CER dialog box when this crash occurs? If so, can you please send it in so we can take a look. Please input your email ID in the CER so we can identify it came from you.

 

We do have a change request logged on a similar issue but I am not sure it is the same. A CER from you can confirm that.

 

Your other options is to check if the e.Context object is a valid .NET object. Does this happen on 32 bit or 64 bit platforms?

 

Cheers

Gopinath

0 Likes
Message 3 of 7

Anonymous
Not applicable

No AutoCAD CER Dialogs appear. This is a 32-bit installation of AutoCAD. 

 

If it helps when I hit retry it takes to that point in the code and it works fine afterwards. 

 

What way do you recommend of checking to see if it is a valid .NET object?

 

0 Likes
Message 4 of 7

gopinath.taget
Alumni
Alumni

There a few ways. If you have Visual Studio, you can debug through the code watch to see if the Context object is null. If it is not null, you could call other methods on the e.Context and see if they assert as well. You can watch the Output window of visual studio during debugging and stepping over the offending code to see if there is any extra information posted there.

 

Is there a chance you can provide a minimal sample to reproduce the problem? Are you able to reproduce the problem consistently?

0 Likes
Message 5 of 7

Jeff_M
Consultant
Consultant

I'm seeing this occassionally as well. In the same drawing, it may pop up quickly, or not for a number of minutes, or even not at all. It seems to be very random. The drawing contains Lines, LWPolylines, Dimensions, and BlockReferences of a Dynamic block...nothing else, for a total of 198 entities. I can move the cursor quick, slow, up, down, make selections, etc., but cannot pinpoint anything in particular that triggers the error. And it is more of a warning error, not a crash, so no CER. Note that I have the code to check the e.context wrapped in a Try...Catch clause which does not catch this.

        public static void MyOnMonitorPoint(object sender, PointMonitorEventArgs e)
        {
          ObjectIdCollection idc = new ObjectIdCollection();
          try
            {
                FullSubentityPath[] paths = e.Context.GetPickedEntities();
                if (paths.Length <= 0)
                {
                   return;
                }
                foreach (FullSubentityPath path in paths)
                    {
                        ObjectId[] ids = path.GetObjectIds();
                        foreach (ObjectId id in ids)
                            if (!idc.Contains(id))
                                idc.Add(id);
                    }
            }
            catch { }
            //operate on the idc now
        }

 Oh, and this is using Autocad 2012.

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 6 of 7

Anonymous
Not applicable

Jeff M sums it up. I'm using AutoCAD Map 2012.

0 Likes
Message 7 of 7

rmduser
Contributor
Contributor
Accepted solution

Hi!

 

I've noticed that too in one of my AutoCAD .NET extensions.

No idea, why there are Debug Assertions in a Release product, as - at least to me - there is no way to catch such an error, as would be the case with an Exception (d'oh!).

 

Anyway, I've found out for myself that the SysVar ROLLOVERTIPS (to display fancy tooltips) seems to cause the issue, if there are more than (1, 2, 3, dunno) entities (or even entity graphics?) under the cursor pickbox (or so).

Turning off ROLLOVERTIPS solved (or circumvented) the problem for me.

 

I've asked ADN Support already with the result that for "plain" AutoCAD 2012 there is already a Service Pack that addresses this issue.

The Map 3D SP1 rolled out a week ago (I think) which also seems to fix this.

 

Cheers,

Fred