Message 1 of 1
Adding Map OD Table fields

Not applicable
05-02-2002
06:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I tried posting my question to the Map customization forum but didn't receive any response. Perhaps someone here has worked in Map...
Could anyone please tell me why this doesn't work? I have an existing OD table called "Watersheds-Post" with 2 fields and want to add a field to it through vba:
Dim amap As AcadMap Dim ODtb As ODTable Dim ODfdf As ODFieldDef Set amap = ThisDrawing.Application.GetInterfaceObject ("AutoCADMap.Application") Set ODtb = amap.Projects(ThisDrawing).ODTables.Item ("Watersheds-Post") Set ODfdf = ODtb.ODFieldDefs.Add("grass", "grass cover in sf", 0, 2)
When I try to test the code, I receive an error:
"Run-time error '-2147352567(80020009)': Method 'Add' of object 'ODFieldDefs' failed" Forgive me if it is something obvious because I'm new at this.
Patrick Huber phuber@cmtengr.com
Could anyone please tell me why this doesn't work? I have an existing OD table called "Watersheds-Post" with 2 fields and want to add a field to it through vba:
Dim amap As AcadMap Dim ODtb As ODTable Dim ODfdf As ODFieldDef Set amap = ThisDrawing.Application.GetInterfaceObject ("AutoCADMap.Application") Set ODtb = amap.Projects(ThisDrawing).ODTables.Item ("Watersheds-Post") Set ODfdf = ODtb.ODFieldDefs.Add("grass", "grass cover in sf", 0, 2)
When I try to test the code, I receive an error:
"Run-time error '-2147352567(80020009)': Method 'Add' of object 'ODFieldDefs' failed" Forgive me if it is something obvious because I'm new at this.
Patrick Huber phuber@cmtengr.com