using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using ESRI.ArcGIS.Controls;
namespace WindowsFormsApplication9
{
public partial class Form1 : Form
{
public Form1()
{
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
InitializeComponent();
}
private void 打開地圖ToolStripMenuItem_Click(object sender, EventArgs e)
{
System.Windows.Forms.OpenFileDialog openFileDialog;
openFileDialog = new OpenFileDialog();
openFileDialog.Title = "打開地圖檔案";
openFileDialog.Filter = "map document(*.dwg)|*.dwg";
openFileDialog.ShowDialog();
string filepath = openFileDialog.FileName;
if (filepath != "" && filepath != null)
if (axMapControl1.CheckMxFile(filepath))
{
axMapControl1.MousePointer = esriControlsMousePointer.esriPointerHourglass;
axMapControl1.LoadMxFile(filepath, 0, Type.Missing);
axMapControl1.MousePointer = esriControlsMousePointer.esriPointerDefault;
}
else
{
MessageBox.Show(filepath + "不是有效地圖");
}
}
}
}
uj5u.com熱心網友回復:
有沒有大神能幫幫我,給我一段打開CAD檔案的代碼也行,要能運行的。感激不盡吶!!!!!!uj5u.com熱心網友回復:
在arcgis官網幫助中搜索 open cad file,有代碼示例的轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/80242.html
