AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Topology problems (Cannot open object for write)

2 REPLIES 2
Reply
Message 1 of 3
jurica
713 Views, 2 Replies

Topology problems (Cannot open object for write)

Hi,

 

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!

 

 

Tags (1)
2 REPLIES 2
Message 2 of 3
tint
in reply to: jurica

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.

 

GC.Collect();

GC.Collect();

GC.WaitForPendingFinalizers();

 

Best regards,

Michael

Message 3 of 3
JEdwardL
in reply to: jurica

I'm having a very similar problem.  Did you find a solution?

 

J

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost