.NET

Reply
Member
ywseo
Posts: 3
Registered: ‎04-05-2012
Message 1 of 4 (288 Views)

AutoCad 2011 Not Open

288 Views, 3 Replies
04-05-2012 06:44 PM

Hi.
I'm CAD Addin developer.
Um ...
AutoCAD 2010 OPEN success.
AutoCAD 2012 OPEN success.
But .... AutoCAD 2011 OPEN failure.

AutoCAD 2010, 2011, 2012 all same source.
Why Not OPEN AutoCAD 2011 ... TT.

DWGCHECK applied ...

Dev Tool: Visual Studio 2008
CAD: AutoCAD Mechanical 2011

=====================================================

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim acadApp As AcadApplication

        Try
            If acadApp Is Nothing Then
                acadApp = GetObject(, "AutoCAD.Application")
            End If
            acadApp.Visible = Visible

        Catch ex As Exception
            Try
                acadApp = CreateObject("AutoCAD.Application.18.1")
                acadApp.Visible = Visible
                'Shell("C:\Program Files\Autodesk\ACADM 2011\acad.exe")
                acadApp.Visible = Visible
            Catch ex1 As Exception
                MsgBox(ex1.Message)
            End Try
        End Try
    End Sub

Valued Contributor
dynamicscope
Posts: 95
Registered: ‎04-04-2012
Message 2 of 4 (286 Views)

Re: AutoCad 2011 Not Open

04-05-2012 06:48 PM in reply to: ywseo

Did you try debugging it?

In which line do you get the error?

Valued Mentor
KerryBrown
Posts: 269
Registered: ‎11-29-2008
Message 3 of 4 (282 Views)

Re: AutoCad 2011 Not Open

04-05-2012 07:32 PM in reply to: ywseo

 

acadApp = CreateObject("AutoCAD.Application.18.1")

 

are you accessing

18.0

18.1

18.2

 

??

 

Regards

 

//-------------------------------------------------------

class keyThumper<T> : Lazy<T>;      another  Swamper

ADN Support Specialist
Balaji_Ram
Posts: 701
Registered: ‎03-21-2011
Message 4 of 4 (265 Views)

Re: AutoCad 2011 Not Open

04-06-2012 04:54 AM in reply to: ywseo

Hi,

 

Using the version independent program id as “AutoCAD.Application” should invoke the last run version of AutoCAD.

 

So you may want to check which version of AutoCAD was invoked just before you run this code.

If not you can mention the prog id of a AutoCAD version that you specifically want to launch.

Ex : “AutoCAD.Application.18.1” for AutoCAD 2011.

 

Using the registry editor open the following key and note the CLSID :

“HKEY_CLASSES_ROOT\AutoCAD.Application\CLSID”

 

For ex : If the CLSID is “6D7AE628-FF41-4CD3-91DD-34825BB1A251”

Look for  “HKEY_CLASSES_ROOT\CLSID\{6D7AE628-FF41-4CD3-91DD-34825BB1A251}\LocalServer32”

 

The path to the executable that will be launched when “AutoCAD.Application” is specified can be verified here.

 

Be careful while working with the registry editor.

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.