Message 1 of 2
VB6 connection to Map 6 Problem
Not applicable
11-20-2003
11:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Group,
I have been attempting to connect to Autodesk Map 7 to create a EXE or DLL
and the code that worked for Map 6 no longer appears to work. Essentially
what is below is what I have used in Map 6 (minus the ".16"), but does not
work any longer in Map 7. I have tried endless permutations of this, dimmed
everything as 'Object', but can only get as far as an AutoCad Document and
then when trying to get map with 'GetInterfaceObject' the code fails. The
'GetInterfaceObject' works for other apps such as the layer manager etc. but
not for map. The code in the Help for both Map 6 & 7 is WRONG and does not
help a bit.
Is anyone developing map with VB or must everything be done in VBA?
Thanks for your help.
'******My Code Follows******
Option Explicit
Public acadapp As AcadApplication
Public acaddoc As AcadDocument
Public acmap As Object
Public Sub main()
Set acadapp = GetObject(, "AutoCad.application.16")
Set acaddoc = acadapp.ActiveDocument
Set acmap = acadapp.GetInterfaceObject("AutoCadMap.application.16")
End Sub
I have been attempting to connect to Autodesk Map 7 to create a EXE or DLL
and the code that worked for Map 6 no longer appears to work. Essentially
what is below is what I have used in Map 6 (minus the ".16"), but does not
work any longer in Map 7. I have tried endless permutations of this, dimmed
everything as 'Object', but can only get as far as an AutoCad Document and
then when trying to get map with 'GetInterfaceObject' the code fails. The
'GetInterfaceObject' works for other apps such as the layer manager etc. but
not for map. The code in the Help for both Map 6 & 7 is WRONG and does not
help a bit.
Is anyone developing map with VB or must everything be done in VBA?
Thanks for your help.
'******My Code Follows******
Option Explicit
Public acadapp As AcadApplication
Public acaddoc As AcadDocument
Public acmap As Object
Public Sub main()
Set acadapp = GetObject(, "AutoCad.application.16")
Set acaddoc = acadapp.ActiveDocument
Set acmap = acadapp.GetInterfaceObject("AutoCadMap.application.16")
End Sub