Message 1 of 6
Not applicable
09-17-2017
12:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I create a application with VS2015 that using COM Interoperability. It working correctly in my computre but when i copy debug folder and run application , while application wants to drawing object in autocad occure exeption error. i create a setup file with VS2015 but its not working.
this is my cad connection:
using System.Runtime.InteropServices;
CadeConnection
{
public dynamic Connect()
{
string progId = "AutoCAD.Application";
dynamic acadApp;
try
{
acadApp = Marshal.GetActiveObject(progId);
}
catch
{
acadApp = Activator.CreateInstance(Type.GetTypeFromProgID(progId));
}
while (true)
{
try
{
acadApp.Visible = true;
break;
}
catch { }
}
return acadApp;
}
}And i use it like this :
using Autodesk.AutoCAD.Interop.Common;
class DrawInAutocade
{
CadeConnection connection = new CadeConnection();
public void Line(double[] Point1, double[] Point2, string LayerName)
{
AcadLine Line = default(AcadLine);
Line = connection.Connect().ActiveDocument.ModelSpace.AddLine(Point1, Point2);
Line.Layer = LayerName;
}
}why introp.common and introp files is not existing in debug folder of VS2015 ???
Solved! Go to Solution.