.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

can not load autocad 2006

1 REPLY 1
Reply
Message 1 of 2
pk91
277 Views, 1 Reply

can not load autocad 2006

Om my computer I have installed AutoCad 2006, and written a program in Visual studio 2006 that generates AutoCad files, on my computer it al works fine.
On the person who has to work with this program has installed on his computer Autocad 2006 LT and Autocad 2002, the problem is that when I install it on his computer it doesn’t see autocad 2006.

I use the following code to start autocad:

using Autodesk.AutoCAD.Interop;
using Autodesk.AutoCAD.Interop.Common;

private Autodesk.AutoCAD.Interop.AcadApplication autoCADApplication;

try
{
autoCADApplication=(Autodesk.AutoCAD.Interop.AcadApplication)System.Runtime.InteropServices.Marshal.GetActiveObject("AutoCAD.Application.16.2");
return;
}
catch
{
try
{
autoCADApplication = new Autodesk.AutoCAD.Interop.AcadApplicationClass();
}
catch
{
MessageBox.Show(this,"Can’t load Autocad 2006.");
}
}

I have referenced the AutoCAD 2006 Type Library and AutoCAD/ObjectDBX Common 16.0 Type Library.

I have already tried to regasm the AutoDesk.Autocad.Interop.dll and AutoDesk.Autocad.Interop.Common.dll files, which did not work.

Has anyone any idea to solve this problem?

Thanks in advance.
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: pk91

So, you are doing AutoCAD COM Automation (although you use VS.NET2005).

Please note, your app will not run on the user's computer with Acad2006LT
and Acad2002:

1. AcadLT (any version, as long as it is LT) does not support automation.
2. Since your app explicitly calls for "AutoCAD.Application.16.2", which is
Acad2006 and does not present on the user's computer, therefore, your app
will not run there. If you have to run your app against multiple version of
Acad, you have to do it differently. Late binding is usually the way.
However, it is a bit difficult now in .NET than in classical VB, especially
when you use C#.

wrote in message news:5132508@discussion.autodesk.com...
Om my computer I have installed AutoCad 2006, and written a program in
Visual studio 2006 that generates AutoCad files, on my computer it al works
fine.
On the person who has to work with this program has installed on his
computer Autocad 2006 LT and Autocad 2002, the problem is that when I
install it on his computer it doesn't see autocad 2006.

I use the following code to start autocad:

using Autodesk.AutoCAD.Interop;
using Autodesk.AutoCAD.Interop.Common;

private Autodesk.AutoCAD.Interop.AcadApplication autoCADApplication;

try
{
autoCADApplication=(Autodesk.AutoCAD.Interop.AcadApplication)System.Runtime.InteropServices.Marshal.GetActiveObject("AutoCAD.Application.16.2");
return;
}
catch
{
try
{
autoCADApplication = new Autodesk.AutoCAD.Interop.AcadApplicationClass();
}
catch
{
MessageBox.Show(this,"Can't load Autocad 2006.");
}
}

I have referenced the AutoCAD 2006 Type Library and AutoCAD/ObjectDBX Common
16.0 Type Library.

I have already tried to regasm the AutoDesk.Autocad.Interop.dll and
AutoDesk.Autocad.Interop.Common.dll files, which did not work.

Has anyone any idea to solve this problem?

Thanks in advance.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost