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

Getobject(,"Autocad.Application.18.0") does not work. Why?

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
2523 Views, 5 Replies

Getobject(,"Autocad.Application.18.0") does not work. Why?

Hi

I have successfully used this code (simplified) with AutoCAD 2008:

Public Module InstallMyMenu
Sub Main()

Dim Acadapp As Autodesk.AutoCAD.Interop.AcadApplication
On Error Resume Next
Acadapp = GetObject(, "Autocad.Application.17.1")
If Err.Number <> 0 Then
MsgBox"No AutoCAD found")
Exit sub
end if

... some further code

end sub
End Module

However the same code using Acadapp = GetObject(, "Autocad.Application.18.0") (referencing AutoCAD 2010 of course) does not work.

Does anybody have an idea why?

BR
Jan Grenov Edited by: jangrenov1826 on Jun 12, 2009 10:51 AM
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous


Is this a NETLOADed application?


style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
Hi
I have successfully used this code (simplified) with AutoCAD 2008: Public
Module InstallMyMenu
Sub Main() Dim Acadapp As
Autodesk.AutoCAD.Interop.AcadApplication
On Error Resume Next
Acadapp = GetObject(, "Autocad.Application.17.1") If Err.Number
<> 0 Then
MsgBox"No AutoCAD found") Exit sub end
if
... some further code end sub End Module However
the same code using Acadapp = GetObject(, "Autocad.Application.18.0")
(referencing AutoCAD 2010 of course) does not work. Does anybody have an idea
why? BR Jan Grenov Edited by: jangrenov1826 on Jun 12, 2009 10:51
AM
Message 3 of 6
Anonymous
in reply to: Anonymous

Hi Joe

No I do not use NETLOAD in this case. I reference the AutoCAD com object and fire up the application. If AutoCAD is present (open) the application then install my company specific menu utilities. ... which worked out fine with AutoCAD release 2008.

BR
Jan
Message 4 of 6
Anonymous
in reply to: Anonymous

Found answer myself (after a couple of hours spent on Google)

AcadApp = Getobject(,"Autocad.Application.18.0")

should actually be ..

AcadApp = Getobject(,"Autocad.Application.18")

Then everything works out fine

:-)
Message 5 of 6
Anonymous
in reply to: Anonymous


Good - I was just about to tell you to drop the 0
after looking at the typelib file.

 

Joe ...

 


style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
Found
answer myself (after a couple of hours spent on Google) AcadApp =
Getobject(,"Autocad.Application.18.0") should actually be .. AcadApp =
Getobject(,"Autocad.Application.18") Then everything works out fine
:-)
Message 6 of 6
Anonymous
in reply to: Anonymous

Hmmm ... looking at the typelib file! ... interesting! I guess that I can learn something new here. I have often wondered where to find this sort of information ... apart from spending lots of time searching on the internet.

What exactly did you do? Just curious ...

Jan

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