.NET

Reply
Active Contributor
jprisbe
Posts: 37
Registered: ‎02-22-2005
Message 1 of 4 (328 Views)

Wblock crashing in .NET

328 Views, 3 Replies
11-19-2012 10:44 AM

I have a .NET DLL that a gathers object ids of entities grouped within bounding boxes and then WBlocks each group of entities to individual dwg files. I'm getting an pretty consistent crash when transaction.commit gets called. If I comment out the wblock call (sourceDatabase.Wblock(targetDatabase, objectIdColl, dwgBasePoint, DuplicateRecordCloning.Ignore)) I never get the crash.

 

Anyone seen anything like this before? Any suggestions?

Active Contributor
jprisbe
Posts: 37
Registered: ‎02-22-2005
Message 2 of 4 (324 Views)

Re: Wblock crashing in .NET

11-19-2012 10:52 AM in reply to: jprisbe

I'm also seeing this every now and then.

 

Untitled.png

Active Contributor
jprisbe
Posts: 37
Registered: ‎02-22-2005
Message 3 of 4 (314 Views)

Re: Wblock crashing in .NET

11-19-2012 11:26 AM in reply to: jprisbe

I also see this sometimes as well.

 

System.InvalidOperationException: Operation is not valid due to the current state of the object.
   at Autodesk.AutoCAD.DatabaseServices.Transaction.CheckTopTransaction()
   at Autodesk.AutoCAD.DatabaseServices.Transaction.DeleteUnmanagedObject()

...

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 4 of 4 (278 Views)

Re: Wblock crashing in .NET

11-20-2012 12:33 PM in reply to: jprisbe

jprisbe wrote:

I also see this sometimes as well.

 

System.InvalidOperationException: Operation is not valid due to the current state of the object.
   at Autodesk.AutoCAD.DatabaseServices.Transaction.CheckTopTransaction()
   at Autodesk.AutoCAD.DatabaseServices.Transaction.DeleteUnmanagedObject()

...


This error happens when you use an API that requires an active transaction, with the most-likely culprits being ObjectId.GetObject() or TransactionManager.GetObject()

 

The problem is in your code, and I suspect the other problem is as well.

 

If you need help tracking down the source of the errors, you're going to have to show the code where it happens. Otherwise, you will have to run your code in the debugger and it should break on the line when the exception occurs.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community