Created
September 3, 2019 14:09
-
-
Save helderdek/2869da459d126bbb319edb110f9108ff to your computer and use it in GitHub Desktop.
Transformando um AxMapControl em arquivo .MXD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void saveMap() | |
{ | |
IMapDocument mapDocument = new MapDocumentClass(); | |
mapDocument.Open("C:\\temp\\Teste.mxd", string.Empty); | |
//if (mapDocument.get_IsReadOnly(@"[path to your .mxd]")) | |
//{ | |
// System.Windows.Forms.MessageBox.Show("Map document \"" + @"[path to your .mxd]" + "\" is read only!"); | |
// mapDocument.Close(); | |
// return; | |
//} | |
mapDocument.ReplaceContents((IMxdContents)axMapControlPrincipal.Map); | |
mapDocument.SaveAs("C:\\temp\\Teste1.mxd", false, true); | |
mapDocument.Close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment