which references required for connect objectdata (map 2019)

which references required for connect objectdata (map 2019)

jan_tappenbeck
Collaborator Collaborator
1,191 Views
3 Replies
Message 1 of 4

which references required for connect objectdata (map 2019)

jan_tappenbeck
Collaborator
Collaborator

hi!

 

i want to read objectdata and found example code by https://forums.autodesk.com/t5/autocad-map-3d-developer/problem-accessing-objectdata/td-p/2911552

 

but my problem is which reference are required to call "Autodesk.Gis.Map.ObjectData.Tables" (this is marked in following code:

 

 Dim tables As Autodesk.Gis.Map.ObjectData.Tables = Autodesk.Gis.Map.HostMapApplicationServices.Application.ActiveProject.ODTables

            Using records As Autodesk.Gis.Map.ObjectData.Records = tables.GetObjectRecords(0, entity.Id, Autodesk.Gis.Map.Constants.OpenMode.OpenForRead, False

)

 

could someone help?

 

regards Jan

 

0 Likes
1,192 Views
3 Replies
Replies (3)
Message 2 of 4

fieldguy
Advisor
Advisor

"ManagedMapApi" is the reference and for me the path is 

C:\Program Files\Autodesk\AutoCAD 2018\Map\ManagedMapApi.dll

You might also need OSGeo - depending on what your doing.

C:\Program Files\Autodesk\AutoCAD 2018\Map\bin\GisPlatform contains

OSGeo.MapGuide.Foundation.dll

OSGeo.MapGuide.Geometry.dll

OSGeo.MapGuide.PlatformBase.dll

remember "Copy local" should be false.

 

0 Likes
Message 3 of 4

jan_tappenbeck
Collaborator
Collaborator

Moin!

 

i added references

 

2019-05-07_11h08_03.png

and define imports:

Imports System
'Imports Microsoft.VisualBasic
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.ApplicationServices

Imports ManagedMapApi
Imports OSGeo.MapGuide.Foundation
Imports OSGeo.MapGuide.PlatformBase

and here the names of Imports are marked with no correction-options!

 

????

 

Addition:

i have a new idea and reduce import to

 

 

'Imports ManagedMapApi

 

 

 

Imports OSGeo.MapGuide

then the marked commands of starting this post are not marked!

 

2019-05-07_11h15_48.png

i hope it will works

 

regards Jan

 

 

 

 

0 Likes
Message 4 of 4

norman.yuan
Mentor
Mentor

There is no namespace called "ManagedMapApi". Instead, the namespace in the ManagedMapApi.dll is like "Autodesk.Gis.Map...", that is, for dealing with ObjectData in AutoCAD Map, you probably need these "Imports..."

 

Imports Autodesk.Gis.Map

Imports Autodesk.Gis.Map.Project

Imports Autodesk.Gis.Map.ObjectData

Imports Autodesk.Gis.Map.Constants

 

As @fieldguy suggested, you may need those "OSGeo.xxx.xxx" depending on what you do with AutoCAD Map. If you only deal with ObjectData, not FDO data source, then there is no need to add references to those DLLs, which is harmless, but unnecessary dependencies to your project.

 

 

Norman Yuan

Drive CAD With Code

EESignature