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: 

Autocad Map file still in use after import

2 REPLIES 2
Reply
Message 1 of 3
andrew_demerchant
365 Views, 2 Replies

Autocad Map file still in use after import

I'm able to import some shp files without any trouble...but for some reason, autocad is keeping the files open after the import, and I want to delete them. I've tried disposing and/or setting vars to nothing, but can't seem to get them released without closing Autocad completely. I've imported using Autodesk.Gis.Map.HostMapApplicationServices.Application.Importer....Anyone have any tips?

2 REPLIES 2
Message 2 of 3

I did a few Map importing/exporting development and had never needed to erase shape files after they being imported into drawing. Yes, I can confirm that Autodesk.Gis.Map.ImportExport.Importer does not release the shape file after it is imported into drawing, thus the shape file (and some of its comopanion files *.dbf, *.shx...).

 

Although Import is an IDisposable object, our custom code cannot really dispose it, even Importer.Dispose() is clled explicitly, because Importer is exposed via static MapApplication as its property. We, as outsider, do not know how this property is implemented, but I'd guess that this property points an singleton of Importer instance, so that as long as the MapApplication alive, the Importer alway lives.Therefore only closing AutoCAD kills the Importer, thus the shape file is released then.

 

Technically, importing shape file is differently from connecting AutoCAD to shape file via FDO, there is no reason for MapApplication/Importer to hold the shape file after it being imported. Autodesk's Map team should take this as a bug to be fixed.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 3

That's definitely what I've found here too. Would be a good bug to get fixed...until then, I guess I'm going to have to come up with a workaround for my project. Thanks

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

Post to forums  

Autodesk Design & Make Report

”Boost