Message 1 of 3
ODTable from entity
Not applicable
02-18-2002
09:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is there a way to determine the ODTable from an entity. Is there another
way other than looping through all the tables and records to get the table
name. In other words can I get an entity's record without hard coding the
table name as in the following example.
Function getObjectData(ent)
Dim amap As AcadMap
Dim ODrcs As ODRecords
Dim acadObj As AcadObject
Dim prj As Project
Dim rec As Object
Set amap = ThisDrawing.Application. _
GetInterfaceObject("AutoCADMap.Application")
Set prj = amap.Projects(ThisDrawing)
prj.ProjectOptions.DontAddObjectsToSaveSet = True
Set ODrcs = amap.Projects.Item(ThisDrawing). _
ODTables.Item(, "STREET_CL").GetODRecords
'get the attribute data for this entity
If ODrcs.Init(ent, True, False) = True And _
Not ODrcs.IsDone Then
Set rec = ODrcs.Record
Else
'If there is no attribute data for this entity then
'Turn it red and do the next one
obj.Color = acRed
obj.Update
End If
Set getObjectData = rec
End Function
Lou Ball
[email protected]
way other than looping through all the tables and records to get the table
name. In other words can I get an entity's record without hard coding the
table name as in the following example.
Function getObjectData(ent)
Dim amap As AcadMap
Dim ODrcs As ODRecords
Dim acadObj As AcadObject
Dim prj As Project
Dim rec As Object
Set amap = ThisDrawing.Application. _
GetInterfaceObject("AutoCADMap.Application")
Set prj = amap.Projects(ThisDrawing)
prj.ProjectOptions.DontAddObjectsToSaveSet = True
Set ODrcs = amap.Projects.Item(ThisDrawing). _
ODTables.Item(, "STREET_CL").GetODRecords
'get the attribute data for this entity
If ODrcs.Init(ent, True, False) = True And _
Not ODrcs.IsDone Then
Set rec = ODrcs.Record
Else
'If there is no attribute data for this entity then
'Turn it red and do the next one
obj.Color = acRed
obj.Update
End If
Set getObjectData = rec
End Function
Lou Ball
[email protected]