hello,
map customization NG may be more helpful
ODRecord.AttachTo(Convert.ToInt32(oEntity.ObjectID))
maybe Convert.ToInt32(oEntity.ObjectID should be Long, am not familiar with VB though
below is vba, previous version of Map code tidbit, hope is helpful
Private Sub addExtendedData_Click()
Me.Hide
Set amap = ThisDrawing.Application.GetInterfaceObject("AutoCADMap.Application.2")
Set ODfdfs = amap.Projects(ThisDrawing).MapUtil.NewODFieldDefs
Set ODfdf = ODfdfs.Add("DA_ID", "Drainage Area ID", "", 0)
Set ODfdf = ODfdfs.Add("Pre_Post_Both", "Pre/Post Development or Both", "", 1)
Set ODfdf = ODfdfs.Add("HSG", "Hydrologic Soil Group", "", 2)
Set ODfdf = ODfdfs.Add("Onsite", "Within Property Boundaries", "", 3)
Set ODfdf = ODfdfs.Add("Cover", "Cover Type", "", 4)
Set ODfdf = ODfdfs.Add("Row", "Within Proposed ROW", "", 5)
If amap.Projects(ThisDrawing).ODTables.Item("Cover") Is Nothing Then
Set ODtb = amap.Projects(ThisDrawing).ODTables.Add("Cover", "Cover Xdata", ODfdfs, True)
Else
Set ODtb = amap.Projects(ThisDrawing).ODTables.Item("Cover")
amap.Projects(ThisDrawing).ODTables.GetODRecords
End If
Set ODrc = ODtb.CreateRecord
amap.Projects(ThisDrawing).ODTables.GetODRecords
AppActivate Application.Caption
On Error Resume Next
ThisDrawing.SelectionSets.Item("sset").delete
On Error GoTo 0
Set sset = ThisDrawing.SelectionSets.Add("sset")
sset.SelectOnScreen
For x = 1 To sset.count
ODrc.Item(0).Value = "0"
ODrc.Item(1).Value = "1"
ODrc.Item(2).Value = "2"
ODrc.Item(3).Value = "3"
ODrc.Item(4).Value = "4"
ODrc.Item(5).Value = "5"
ODrc.AttachTo (sset(x - 1).ObjectID)
Next x
sset.delete
Me.Show
End Sub
Message was edited by: cadger