I'm having a bit of trouble with my programatically created topologies and would appreciate some advice or maybe an explanation for what's causing the problems.
My command (started from a buton in a custom palette) creates two topologies (A and B), overlays them, performs some analyses, prints out the output and that's working fine. I should also mention that it changes the layer for some of the centroids in "A" topology, and that it leaves all three topologies in the drawing after it's finished. Oh, I also dispose of all PolygonCollections after I'm done iterating trough them and close all of the topologies.
The problem is, when you start the same command again, it deletes those topologies and their data tables, and tries to recreate them from scratch. That's when I get the "Cannot open object for write" error. Upon further investigation, I found out that the error occurs even if I try to manually delete the "A" topology. I suspect that it has something to do with modifiying those centroids, but I don't get the same error if I perform all of these actions manually.
Perhaps it has something to do with document locking or transactions mixed with topology operations, I really don't know, so I would very much appreciate any help.
BTW, I'm using Map 3D 2010.
Thanks in advance!
I could join your question.
I have same problems to perform mixed functionality transactions and topology operations.
Only after drawing has been saved and reopened I had ability to delete polygons from topology .
I'm also using GC in my code. May be that will be help for you.