I have created one class that return the list of all Text Object from the active drawing an dI am getting the below mentioned error can anyone please tell me what do you mean by this error ?
If you need more clarification what I have done let me know..
An unhandled exception of type 'System.AccessViolationException' occurred in AcdbMgd.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
The error mesage does not not help much for any one to guess what could be the reason of it. You need to show some code.
If I have to guess from your limited description, obtaining a list of DBObject (DBText in your case) and passing it outside an transaction could be one of the possible reasons. As best-practice approach, you only pass around ObjectId or a collection of ObjectIds and only open DBObject by ObjectId in an Transaction and be done with the DBObject before the Transaction ends.
Again, only your code would get you helped.
Norman Yuan
Dear Bhensdadia,
if you have kind of a loop( such as: For each, for, ...) in your sub, and in this loop you want to get and object by id (like: GetObject, GetClass ...) follow this
in below you can see a sample
Public Function textSelect()
Dim Tr As Transaction = db.TransactionManager.StartTransaction()
'start the transaction
Using Tr
'start of Loop
For Each Id As ObjectId In Ids
'add your code below (the process need to be done on object id)
Next
'Close the transaction
Tr.Commit()
End Using
return t
End Function
I hope it can help
Mehdi