Adding Map OD Table fields

Adding Map OD Table fields

Anonymous
Not applicable
208 Views
0 Replies
Message 1 of 1

Adding Map OD Table fields

Anonymous
Not applicable
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
0 Likes
209 Views
0 Replies
Replies (0)