ODTables.Add method

AutoCAD Map 3D ActiveX

ODTables.Add method

Creates an object data table.

Add( _
 TableName As String, _
 TableDescription As String, _
 ODFieldDefs As ODFieldDefs, _
 StoreAsXData As Boolean _
 ) As ODTable

Returns the specified table.

TableName

At most 29 characters, no spaces.

TableDescription

The description of the table.

ODFieldDefs

Field definitions for the table.

StoreAsXData

True: Record data is stored with drawing objects as extended entity data.

False: Record data is stored with drawing objects as AutoCAD Xrecords.

The following code is an excerpt from a larger example. The code shows how to prevent an error by checking that the table you want to add doesn't already exist. For the entire example, click .

Dim amap As AcadMap

Dim ODfdfs As ODFieldDefs

Dim ODtb As ODTable

 

'Ensure Table Does Not Exist

If amap.Projects(ThisDrawing) _

.ODTables.Item("TableA") Is Nothing Then 

 

'Register OD Table in the drawing 

Set ODtb = amap.Projects(ThisDrawing) _ 

.ODTables.Add("TableA", "Sample Xdata", ODfdfs, True) 

.

.

.

End If