VB6 connection to Map 6 Problem

VB6 connection to Map 6 Problem

Anonymous
Not applicable
343 Views
1 Reply
Message 1 of 2

VB6 connection to Map 6 Problem

Anonymous
Not applicable
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
0 Likes
344 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Bryan,

Try using "AutoCADMap.Application.2" .

Hope this helps.

Gary.



"Bryan Waller" wrote in message
news:8EFA6C0032DD149A6C271C82A52D5CC9@in.WebX.maYIadrTaRb...
> 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
>
>
0 Likes