.NET

Reply
Contributor
eliot
Posts: 20
Registered: ‎06-06-2005
Message 1 of 4 (240 Views)

How to use ResolveXrefs

240 Views, 3 Replies
09-04-2006 06:29 PM
hi everyone,

I'm working on getting xref information and encountered a crash after using ResolveXrefs method.

In my host application, I use RuntimeSystem.Initialize() at the beginning and call RuntimeSystem.Terminate() upon exit. When opening a drawing for getting xref information, ResolveXrefs(false, true) is called in order to resolve xref links.

The problem is if the drawing contain nested xrefs, and there are unresolved xref in the nested ones, calling to RuntimeSystem.Terminate() will cause crash.

The crash is a System.AccessViolationException. Here is what I got.
>?acdbCleanUp@@$$FYA?AW4ErrorStatus@Acad@@XZ()
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

I have no idea what's wrong with it? Am I miss something when calling ResolveXrefs? Is there anything I need dispose? Do I need to lock the document?

Please give me some advice. Thanks.
Contributor
eliot
Posts: 20
Registered: ‎06-06-2005
Message 2 of 4 (240 Views)

Re: How to use ResolveXrefs

09-06-2006 05:18 AM in reply to: eliot
To narrow down the issue, I found ResolveXrefs method will throw an UriFormatException under some circumstances. Is there anyone who know why this exception was thrown? And what is the proper way of handling?

I add several event handler to current database, and found during the execution of ResolveXrefs method, there are at least four events fired. They are XrefBeginAttached, XrefRedirected, XrefBeginOtherAttached and XrefAttachEnded. Seems the last event will be triggered only when all the xrefs have been handled (although there still exists unresolved xrefs). To my problem, the UriFormatException was fired after callback for XrefBeginOtherAttached is triggered. I think when the exception was thrown, there are something that need to be disposed, but unfortunately, I have no idea what should be disposed. And this should be the reason why RuntimeSystem.Terminate() failed with AV exception.

I would appreciate if anyone can give me some help. Many thanks!
Distinguished Contributor
Dale.Bartlett
Posts: 142
Registered: ‎01-06-2003
Message 3 of 4 (116 Views)

Re: How to use ResolveXrefs

11-28-2012 10:08 PM in reply to: eliot

Many years on... Does anyone have a solution for this? I find that unresolved Xrefs in nested Xrefs lead to errors with binding, but I have been unable to come to a way of catching it.  

Valued Mentor
fieldguy
Posts: 371
Registered: ‎03-31-2005
Message 4 of 4 (96 Views)

Re: How to use ResolveXrefs

11-30-2012 08:50 AM in reply to: Dale.Bartlett
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

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