AutoCAD Map 3D Developer

AutoCAD Map 3D Developer

Reply
Contributor
tint
Posts: 22
Registered: ‎05-15-2007
Message 1 of 3 (288 Views)

MapException ErrorNotClosed

288 Views, 2 Replies
05-30-2011 05:26 AM

Hi All.

I'm trying to remove a polygons from Topology and getting error -  MapException " ErrorNotClosed 1011"

 

---------------------------------------------------------------------------

TopologyModel topo = null; 

MapApplication mapApp = HostMapApplicationServices.Application;

Topologies topos = mapApp.ActiveProject.Topologies;

topo = topos[resTopoName];

topo.Open(Autodesk.Gis.Map.Topology.OpenMode.ForWrite);

 

PolygonCollectioncolPolygons = topo.GetPolygons();

 

for (inti = 0; i < colPolygons.Count; i++)

{

   Polygon poly = colPolygons[i] asPolygon;

       topo.DeletePolygon(poly);

}

topo.Close();

---------------------------------------------------------------------------------------------

 

I don't know what exactly source of this error.

I had performed multiple operations before running this code with topology

and topology is  correct and complete,  But I cannot succeed to delete polygons from topology.

By the way, Manually it's work perfectly.

Thank you for help.

 

 

ADN Support Specialist
Partha.Sarkar
Posts: 543
Registered: ‎06-09-2009
Message 2 of 3 (280 Views)

Re: MapException ErrorNotClosed

05-30-2011 10:48 AM in reply to: tint

Hi,

 

Could you try with the DeletePolygon(polygonId ) ?

void DeletePolygon(
    System::Int32 polygonId
);

 

Does that work fine ?

 

Partha Sarkar

Autodesk Developer Network



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Contributor
tint
Posts: 22
Registered: ‎05-15-2007
Message 3 of 3 (276 Views)

Re: MapException ErrorNotClosed

05-30-2011 07:04 PM in reply to: tint

Hello,

I had tried it before. But is strange. It's work only when the drawing has been saved and reopened.

Let me know how to use transaction correctly with delete polygon statement.

I think map objects not closed sufficient with transaction that I had used before.

Thanks

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.