ODTable.GetODRecords method

AutoCAD Map 3D ActiveX

ODTable.GetODRecords method

Gets the collection of all records in the table.

GetODRecords( ) As ODRecords

Returns the collection.

Note that the ODRecords collection iterates the records of only one object at a time, as set by ODRecords.Init. If you get ODRecords through an ODTables collection, you can iterate the object records regardless of which table they are from. If you get ODRecords through an ODTable object, you can iterate only those object records from that table, as shown in the following example.

The following example builds on sample code for creating object data tables. For more information, click . The example shows how to get the records of a selected object and print them in the Immediate Window. Add the following code to the end of the sample code for creating object data tables. Change the name of the table from SampleOD to another name and run the sample again.

Dim ODrcs As ODRecords

Dim boolVal As Boolean

Dim returnObj As AcadObject

Dim basePnt As Variant

Dim i As Integer

 

Set ODrcs = amap.Projects.Item(ThisDrawing). _

ODTables.Item("SampleOD").GetODRecords 

 

'Prompt user to select an object

ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"

boolVal = ODrcs.Init(returnObj, True, False)

Debug.Print ODrcs.Record.tableName

Debug.Print ODrcs.Record.ObjectID

For i = 0 To ODrcs.Record.Count - 1 

Debug.Print ODrcs.Record.Item(i).Value 

Next i