Home > Back-end >  With ArcGIS open DWG format CAD file shows is not a valid map, you great god help me to look at the
With ArcGIS open DWG format CAD file shows is not a valid map, you great god help me to look at the

Time:09-26

using System;
Using System. Collections. Generic;
Using System.Com ponentModel;
Using System. The Data;
Using System. Drawing;
Using System. Linq;
Using System. The Text;
Using System. Windows. Forms;
Using System. IO;
. Using ESRI ArcGIS. Controls;

The namespace WindowsFormsApplication9
{
Public partial class Form1: Form
{


Public _click ()
{
ESRI. ArcGIS. RuntimeManager. Bind (. ESRI ArcGIS. ProductCode. EngineOrDesktop);
InitializeComponent();
}



Private void open map ToolStripMenuItem_Click (object sender, EventArgs e)
{
System. Windows. Forms. OpenFileDialog OpenFileDialog;
OpenFileDialog=new openFileDialog ();
OpenFileDialog. Title="open the map document";
OpenFileDialog. Filter="map document (the *. DWG) | *. DWG";
OpenFileDialog. ShowDialog ();
String filepath=openFileDialog. FileName;

If (filepath!="" & amp; & Filepath!=null)

If (axMapControl1 CheckMxFile (filepath))
{
AxMapControl1. MousePointer=esriControlsMousePointer. EsriPointerHourglass;
AxMapControl1. LoadMxFile (filepath, 0, the Missing);
AxMapControl1. MousePointer=esriControlsMousePointer. EsriPointerDefault;
}
The else
{
MessageBox. Show (filepath + "is not a valid map");
}
}

}
}

CodePudding user response:

Can have a great god help me, give me a code to open CAD files, need to be able to run, very grateful!!!!!!!!!!!!!!!

CodePudding user response:

In arcgis website to help search the open cad file, there are code examples
  • Related