eWasNotOpenForWrite when over attribute

Ok, so this is the bug that was the most mysterious, but the least frustrating. Although it was as stupid as the next...

What I'm trying to do:

Add a BlockReference to the Modelspace with a couple of BlockAttribute's.

Problem: everything works well, until you're in AutoCAD, hovering over an attribute. This causes AutoCAD to shut down with the following message:

scandr.cpp 815 eWasNotOpenForWrite.

This somewhat obscure message got me searching all over my code for stuff I was not closing (DBObject.DowngradeOpen())...

After comparing my code with code I have written previously, I found out that the answer was in fact pretty simple:

When adding the AttributeReference to the BlockReference, I forgot to call Transaction.AddNewlyCreatedDBObject(..).

Posted by Bert Vanpeteghem 0 reacties

Frustrations

Sometimes frustrations can lead to good things. In my case my frustration has finally pulled me over the line to start blogging. I just spent half a day on a bug, so ridiculous, that I don't ever want to forget it again...

Since I'm still busy fixing bug n° 2, I will post the details in the next post

Posted by Bert Vanpeteghem 4 reacties