AlexB58 Posted February 24, 2010 Posted February 24, 2010 Hello: How to connect to AutoCAD on Windows7 (or Vista) 64-bit from standing alone VB6 application? Why the following code (or similar simple procedures, like ACADDOC.SendCommand...) is producing “Type mismatch” error in above-shown environment. ''sample of code.... Public ACADAPP As AcadApplication Public ACADDOC As AcadDocument Private Sub GetLength() Set ACADAPP = GetObject(, "Autocad.Application") Set ACADDOC = ACADAPP.ActiveDocument AppActivate ACADAPP.Caption MsgBox (ACADDOC.Utility.GetDistance(, vbCrLf & "Get Length:")) End Sub What is the name of reference and location of AutoCAD VBA library on 64-bit OS? --- For AutoCAD2010 on Windows XP 32-bit those are: AutoCAD 2010 Type Library (IS IT DIFFERENT IN 64-BIT?) Location C:\Program Files\Common Files\Autodesk Shared\acadx18enu.tlb (IS IT DIFFERENT IN 64-BIT?) --- Any help will be appreciated Alex Quote
MSasu Posted February 25, 2010 Posted February 25, 2010 First, presume that you have already installed VBA Enabler for AutoCAD 2010 since isn’t natively supported on this version. Second, I think that using GetObject statement is required to specify AutoCAD version also: Set ACADAPP = GetObject(, "Autocad.Application[color=red].18[/color]") Or use CreateObject statement to launch default installation or your workstation: Set ACADAPP = CreateObject(, "Autocad.Application") Regards, PS. Try to use code formatter (# button) to improve readability of your post. Quote
AlexB58 Posted February 25, 2010 Author Posted February 25, 2010 Unfortunately, adding .18 doesn't help Set ACADAPP = GetObject(, "Autocad.Application.18") doesn't work. Alex Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.