private void button3_Click(object sender, EventArgs e) //открытие Autocad
{
const string progID = "AutoCAD.Application.23";
AcadApplication acApp = null;
try
{
acApp = (AcadApplication)Marshal.GetActiveObject(progID);
}
catch
{
try
{
Type acType = Type.GetTypeFromProgID(progID);
acApp = (AcadApplication)Activator.CreateInstance(acType, true);
}
catch
{
MessageBox.Show( "Cannot create object of type \"" + progID + "\"");
}
}
if (acApp != null)
{
acApp.Visible = true;
acApp.ActiveDocument.SendCommand(" (COMMAND \"_insert\" \"isp1.dwg\" \"0,0\" 1 1 0 \"\") ");
}
}