<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ODTable from entity in AutoCAD Map 3D Developer Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/odtable-from-entity/m-p/625995#M5640</link>
    <description>Is there a way to determine the ODTable from an entity.  Is there another&lt;BR /&gt;
way other than looping through all the tables and records to get the table&lt;BR /&gt;
name.  In other words can I get an entity's record without hard coding the&lt;BR /&gt;
table name as in the following example.&lt;BR /&gt;
&lt;BR /&gt;
Function getObjectData(ent)&lt;BR /&gt;
    Dim amap As AcadMap&lt;BR /&gt;
    Dim ODrcs As ODRecords&lt;BR /&gt;
    Dim acadObj As AcadObject&lt;BR /&gt;
    Dim prj As Project&lt;BR /&gt;
    Dim rec As Object&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    Set amap = ThisDrawing.Application. _&lt;BR /&gt;
    GetInterfaceObject("AutoCADMap.Application")&lt;BR /&gt;
&lt;BR /&gt;
    Set prj = amap.Projects(ThisDrawing)&lt;BR /&gt;
    prj.ProjectOptions.DontAddObjectsToSaveSet = True&lt;BR /&gt;
&lt;BR /&gt;
    Set ODrcs = amap.Projects.Item(ThisDrawing). _&lt;BR /&gt;
    ODTables.Item(, "STREET_CL").GetODRecords&lt;BR /&gt;
&lt;BR /&gt;
        'get the attribute data for this entity&lt;BR /&gt;
        If ODrcs.Init(ent, True, False) = True And _&lt;BR /&gt;
            Not ODrcs.IsDone Then&lt;BR /&gt;
            Set rec = ODrcs.Record&lt;BR /&gt;
        Else&lt;BR /&gt;
            'If there is no attribute data for this entity then&lt;BR /&gt;
            'Turn it red and do the next one&lt;BR /&gt;
&lt;BR /&gt;
            obj.Color = acRed&lt;BR /&gt;
            obj.Update&lt;BR /&gt;
        End If&lt;BR /&gt;
    Set getObjectData = rec&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Lou Ball&lt;BR /&gt;
lball@eqt.com</description>
    <pubDate>Tue, 19 Feb 2002 05:29:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2002-02-19T05:29:04Z</dc:date>
    <item>
      <title>ODTable from entity</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/odtable-from-entity/m-p/625995#M5640</link>
      <description>Is there a way to determine the ODTable from an entity.  Is there another&lt;BR /&gt;
way other than looping through all the tables and records to get the table&lt;BR /&gt;
name.  In other words can I get an entity's record without hard coding the&lt;BR /&gt;
table name as in the following example.&lt;BR /&gt;
&lt;BR /&gt;
Function getObjectData(ent)&lt;BR /&gt;
    Dim amap As AcadMap&lt;BR /&gt;
    Dim ODrcs As ODRecords&lt;BR /&gt;
    Dim acadObj As AcadObject&lt;BR /&gt;
    Dim prj As Project&lt;BR /&gt;
    Dim rec As Object&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    Set amap = ThisDrawing.Application. _&lt;BR /&gt;
    GetInterfaceObject("AutoCADMap.Application")&lt;BR /&gt;
&lt;BR /&gt;
    Set prj = amap.Projects(ThisDrawing)&lt;BR /&gt;
    prj.ProjectOptions.DontAddObjectsToSaveSet = True&lt;BR /&gt;
&lt;BR /&gt;
    Set ODrcs = amap.Projects.Item(ThisDrawing). _&lt;BR /&gt;
    ODTables.Item(, "STREET_CL").GetODRecords&lt;BR /&gt;
&lt;BR /&gt;
        'get the attribute data for this entity&lt;BR /&gt;
        If ODrcs.Init(ent, True, False) = True And _&lt;BR /&gt;
            Not ODrcs.IsDone Then&lt;BR /&gt;
            Set rec = ODrcs.Record&lt;BR /&gt;
        Else&lt;BR /&gt;
            'If there is no attribute data for this entity then&lt;BR /&gt;
            'Turn it red and do the next one&lt;BR /&gt;
&lt;BR /&gt;
            obj.Color = acRed&lt;BR /&gt;
            obj.Update&lt;BR /&gt;
        End If&lt;BR /&gt;
    Set getObjectData = rec&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Lou Ball&lt;BR /&gt;
lball@eqt.com</description>
      <pubDate>Tue, 19 Feb 2002 05:29:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/odtable-from-entity/m-p/625995#M5640</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-02-19T05:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: ODTable from entity</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/odtable-from-entity/m-p/625996#M5641</link>
      <description>"Lou Ball" &lt;LBALLEQT&gt; wrote in message&lt;BR /&gt;
news:A2FD3CE05CA9A246FC23BD40C05ED764@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Is there a way to determine the ODTable from an entity.  Is there another&lt;BR /&gt;
&amp;gt; way other than looping through all the tables and records to get the table&lt;BR /&gt;
&amp;gt; name.  In other words can I get an entity's record without hard coding the&lt;BR /&gt;
&amp;gt; table name as in the following example.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
Hello Lou,&lt;BR /&gt;
&lt;BR /&gt;
You can allocate an od record iterator for *all*&lt;BR /&gt;
tables rather than a single table.  This is&lt;BR /&gt;
available from the ODTables.GetODRecords instead&lt;BR /&gt;
of the individual ODTable.GetODRecords&lt;BR /&gt;
&lt;BR /&gt;
The Map Automation API even has a small example&lt;BR /&gt;
of its use.&lt;BR /&gt;
&lt;BR /&gt;
Cheers-&lt;BR /&gt;
&lt;BR /&gt;
rdh.&lt;/LBALLEQT&gt;</description>
      <pubDate>Tue, 19 Feb 2002 17:54:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/odtable-from-entity/m-p/625996#M5641</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-02-19T17:54:53Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/odtable-from-entity/m-p/625997#M5642</link>
      <description>Richard,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your reply.&lt;BR /&gt;
Actually I tried using the GetODRecords method but was getting a record for&lt;BR /&gt;
the entity from the wrong table.&lt;BR /&gt;
When I use GetODRecords am I not searching *all* records in *all* tables?&lt;BR /&gt;
It seems that the entity itself has no method or property that refers to&lt;BR /&gt;
object data.  Is that true?&lt;BR /&gt;
&lt;BR /&gt;
Lou&lt;BR /&gt;
&lt;BR /&gt;
"Richard D. Howard [Autodesk GIS]" &lt;RICHARD.HOWARD&gt; wrote in&lt;BR /&gt;
message news:D680E701E129D12DE4811A0DE5DC24B6@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Lou Ball" &lt;LBALLEQT&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:A2FD3CE05CA9A246FC23BD40C05ED764@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; Is there a way to determine the ODTable from an entity.  Is there&lt;BR /&gt;
another&lt;BR /&gt;
&amp;gt; &amp;gt; way other than looping through all the tables and records to get the&lt;BR /&gt;
table&lt;BR /&gt;
&amp;gt; &amp;gt; name.  In other words can I get an entity's record without hard coding&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; &amp;gt; table name as in the following example.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Hello Lou,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; You can allocate an od record iterator for *all*&lt;BR /&gt;
&amp;gt; tables rather than a single table.  This is&lt;BR /&gt;
&amp;gt; available from the ODTables.GetODRecords instead&lt;BR /&gt;
&amp;gt; of the individual ODTable.GetODRecords&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; The Map Automation API even has a small example&lt;BR /&gt;
&amp;gt; of its use.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Cheers-&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; rdh.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/LBALLEQT&gt;&lt;/RICHARD.HOWARD&gt;</description>
      <pubDate>Thu, 21 Feb 2002 05:18:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/odtable-from-entity/m-p/625997#M5642</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-02-21T05:18:04Z</dc:date>
    </item>
  </channel>
</rss>

