Using VB to open the correct version of AutoCAD

Using VB to open the correct version of AutoCAD

Anonymous
Not applicable
1,430 Views
2 Replies
Message 1 of 3

Using VB to open the correct version of AutoCAD

Anonymous
Not applicable

I have both AutoCad 2015 and 2018 (recently installed) in order to test all my VB/Lisp programs before cutting the cord with AutoCAD 2015.

 

Several of my VB applications will check to see if AutoCAD is already opened and if not, open it. My problem is that I have AutoCAD 2018 running, but my VB program will open AutoCAD 2015 instead.

 

Is there a way in VB to open AutoCAD based upon its version (2018 instead of 2015)?

 

Any help would greatly be appreciated

0 Likes
Accepted solutions (1)
1,431 Views
2 Replies
Replies (2)
Message 2 of 3

Ed__Jobe
Mentor
Mentor
Accepted solution

AFAIK, there isn't a way to do that in vba since this is an operating system function. By default, the handler for the dwg  extension is acLauncher.exe. You could change it to the acad.exe for 2018, but you would have to do that for each user. If you are using the GetObject/CreateObject method of obtaining an instance of AcadApplication, then simply start 2018 before you run your app. There might be a more complicated way using shell, but since this sounds like a temporary problem that will exist only until you uninstall 2015, I would take the manual approach and just open 2018 first.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 3

Anonymous
Not applicable
Thank you for your response. I assumed there was not a way to distinguish between the two versions as the VB syntax for opening Autocad did not indicate the version, but I hoped someone had a work around.
Once I blow away version 2015, the issue should resolve itself.

0 Likes