Thanks for your help, however...
I added your line at top - If e.DBObject.IsWriteEnabled Then Exit Sub
Immediate window:
BlockReference
PanelRef c1560e2c-de48-436c-840d-c38942c71e19
BlockReference
PanelRef c1560e2c-de48-436c-840d-c38942c71e19
BlockReference
PanelRef c1560e2c-de48-436c-840d-c38942c71e19
A first chance exception of type 'System.Runtime.InteropServices.SEHException' occurred in AcdbMgd.dll
A first chance exception of type 'System.NullReferenceException' occurred in AcdbMgd.dll
Still crashes. For some reason changing the dynamic property its the object modified 3 times or more (crashed on 3rd time). The exact missing data (null reference) is the dynamic property collection...
The effect of crash is the combination of my ReactToChange and this object. In react to change I run this to get a dynamic property:
Code:
Public ReadOnly Property XDictionary(ByVal classID As Guid, ByVal strDictName As String) As DBDictionary
Get
Dim dbd As DBDictionary = Nothing
Dim dbdColl As DBDictionary = Nothing
Dim trans As Transaction = db.TransactionManager.StartTransaction
Dim NOD As DBDictionary
Dim dbdObjTree As DBDictionary
Try 'to get existing Dictionary
NOD = trans.GetObject(db.NamedObjectsDictionaryId, OpenMode.ForRead)
dbdObjTree = trans.GetObject(NOD.GetAt("srwlObjectTree"), OpenMode.ForRead)
dbdColl = trans.GetObject(dbdObjTree.GetAt(strDictName), OpenMode.ForRead)
If dbdColl.Contains(classID.ToString) Then
dbd = trans.GetObject(dbdColl.GetAt(classID.ToString), OpenMode.ForRead)
Else
NOD.UpgradeOpen()
dbdObjTree.UpgradeOpen()
dbdColl.UpgradeOpen()
dbd = New DBDictionary
dbdColl.SetAt(classID.ToString, dbd)
trans.AddNewlyCreatedDBObject(dbd, True)
End If
trans.Commit()
Catch 'create a new Dictionary instead
MsgBox("Error creating a new " & strDictName & " Dictionary. " & Err.Description)
Finally 'store a reference the dictionary in live memory
trans.Dispose()
End Try
Return dbd
End Get
End Property
While running this, I am setting off the event again, but only for dynamic properties, not for other block properties. Any clue?
Thanks,
jamie