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: 

MapException ErrorNotClosed

2 REPLIES 2
Reply
Message 1 of 3
tint
511 Views, 2 Replies

MapException ErrorNotClosed

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.

 

 

2 REPLIES 2
Message 2 of 3
Partha.Sarkar
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

Message 3 of 3
tint
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

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

Post to forums  

Autodesk Design & Make Report

”Boost