Hello!
I have a problem with adding attributeReferences to a blockReference.
I use the following lines to add the attribute (see attachment for the full method):
...
AttributeDefinition attDef = new AttributeDefinition(new Point3d(0d, 0d, 0d), "TestValue", "AttName", "", db.Textstyle);
btrBlock.AppendEntity(attDef);
trans.AddNewlyCreatedDBObject(attDef, true);
...
AttributeReference attRef = new AttributeReference();
attRef.SetAttributeFromBlock(attDef, blockRef.BlockTransform);
blockRef.AttributeCollection.AppendAttribute(attRef);
blockRef.AttributeCollection.
...
After running the method no error occurs, but when I want to edit the attributes of the block (dubleklick on it), I get the following AutoCAD-Exception:
!AcEAttedit.cpp@403: eWasOpenForWrite
When I continue drawing, ACAD2006 crashes completely.
I spend hours with this problem, but I still haven't found why this error appears. Ok, the error shows me that something ist still open, and should be closed - but what?