Yes I am using Autocad Map 3D 2005. I was given this code as an example but it doesn't seem to work.
__________________________________________________________
Code:
Dim ODrcs As ODRecords
Dim returnObj As AcadObject
Dim i As Integer
Dim strMsg As String
Dim boolVal
Set amap = ThisDrawing.Application.GetInterfaceObject("AutoCADMap.Application")
Set ODrcs = amap.Projects.item(ThisDrawing).ODTables.item("MY_OD_TABLE_NAME").GetODRecords
'Prompt user to select an object
ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"
boolVal = ODrcs.Init(returnObj, True, False)
strMsg = ODrcs.Record.tableName & vbNewLine
strMsg = strMsg & ODrcs.Record.objectID & vbNewLine
For i = 0 To ODrcs.Record.count - 1
strMsg = strMsg & ODrcs.Record.item(i).Value & vbNewLine
Next i
MsgBox strMsg
__________________________________________________________
I always get a run time error on this line:
Set amap = ThisDrawing.Application.GetInterfaceObject("AutoCADMap.Application")
any suggestions?