Hi all, This is really strange and I can't quite figure it out.
I have a dictionary in the NOD with several xrecords. I want to change an entry value in one but the others in the dictionary also get changed. How would they be connected?
This is some simlified code that looks at two xrecords, changes one, then reports the new values. Wierd thing is that both xrecords get changed.
For i = 1 To 2 XRecId = MyAppDict.GetAt(i) XRec = trans.GetObject(XRecId, OpenMode.ForRead) ed.WriteMessage(vbLf + "XRecord: " & i & " First Entry: " & XRec.Data(0).value) Next XRecId = MyAppDict.GetAt(2) XRec = trans.GetObject(XRecId, OpenMode.ForWrite) Dim data As ResultBuffer = New ResultBuffer(New TypedValue(DxfCode.Int16, 2), New TypedValue(DxfCode.Text, XRec.Data(1).value)) XRec.Data = data For i = 1 To 2 XRecId = MyAppDict.GetAt(i) XRec = trans.GetObject(XRecId, OpenMode.ForRead) ed.WriteMessage(vbLf + "XRecord: " & i & " First Entry: " & XRec.Data(0).value) Next
Solved! Go to Solution.
Solved by Alfred.NESWADBA. Go to Solution.
Hi,
try to do a trans.Commit (and create a new transaction) after modifying the data/before starting the loop testreading it.
To make it easier (less work) for us to test this, help us with uploading a drawing with your XRecords attached.
- alfred -
Thanks Alfred.
I committed the transaction but also removed the xrecord then replaced it in the next transaction.
Strange that it was doing that.