.NET

Reply
New Member
pk91
Posts: 2
Registered: ‎02-10-2006
Message 1 of 2 (134 Views)

can not load autocad 2006

134 Views, 1 Replies
04-05-2006 04:53 AM
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.
*Norman Yuan
Message 2 of 2 (134 Views)

Re: can not load autocad 2006

04-05-2006 07:33 AM 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.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.