Re: Undo Dictionary Changes
Do you explicitly set Start and End Undo marks in your routine?
I think there might be implicit Start and End Undo marks, but I haven't quite figured out the rules for them. I think it has something to do with the method of invocation. But in any case, I have found it more-reliable to explicitly set a Start Undo mark at the beginning of your routine, then an End Undo mark at the end of your routine. Otherwise, you will undo all the way back to the last command that set an undo mark.
Re: Undo Dictionary Changes
I was under the impression that using Transaction did this already. I'll try setting an Undo marker. I'm not sure if I'd seen that in the API, could you tell me where abouts it might be?
Re: Undo Dictionary Changes
You are probably right.
All of my development right now is for Civil-3D, and unfortunately, C3D does not have a .NET API. That means that all my code is this nasty mix of .NET and COM objects. I think that's why I've found that I often need to explicitly control undo marks - transactions do not work for objects accessed directly via COM methods. They only know about objects that are opened using the GetObject() method on the transaction. And the controls I use are on the AeccApplication interface object used to talk to C3D, so they are not available to you.
But there is a similar option in the COM Document class in the VBA/ActiveX documentation. If you are only using .NET objects, then I think you're right, and transactions should take care of it all. But if you want to try explicitly setting the mark to see if it helps any, you can try digging down to the COM Document object (use the AcadObject() method from your .NET Document), which has StartUndoMark() and EndUndoMark() methods.