AutoCAD Map 3D Developer

AutoCAD Map 3D Developer

Reply
New Member
jurica
Posts: 1
Registered: ‎01-19-2010
Message 1 of 3 (449 Views)

Topology problems (Cannot open object for write)

449 Views, 2 Replies
02-23-2011 12:59 AM

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!

 

 

Contributor
tint
Posts: 20
Registered: ‎05-15-2007
Message 2 of 3 (333 Views)

Re: Topology problems (Cannot open object for write)

05-31-2011 06:07 AM 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

Valued Contributor
JEdwardL
Posts: 67
Registered: ‎03-02-2004
Message 3 of 3 (215 Views)

Re: Topology problems (Cannot open object for write)

12-21-2011 10:42 AM in reply to: jurica

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

 

J

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!