<?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 Re: Trying To Read Object Data from a Civil3D drawing in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12136479#M8086</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9836010"&gt;@lee.morse&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't understand you&lt;BR /&gt;Can you explain with pictures?&lt;BR /&gt;Do you want the code to Works with all elements in the drawing&lt;BR /&gt;without choosing&lt;/P&gt;</description>
    <pubDate>Sun, 30 Jul 2023 11:34:29 GMT</pubDate>
    <dc:creator>hosneyalaa</dc:creator>
    <dc:date>2023-07-30T11:34:29Z</dc:date>
    <item>
      <title>Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12106034#M8072</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying my first few tentative steps with coding for AutoCad with .NET, I am a NOOB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have several objects in my drawing with object data attached. I am trying to read through the object data, but the code does not seem to find it. The below code fails the check at 'If (extensionDict IsNot Nothing AndAlso extensionDict.Contains("ACAD_OBJECT_DATA"))', I would expect this not to fail if there is ObjectData.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone explain why I am not seeing what I am expecting?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Imports Autodesk.AutoCAD.ApplicationServices&lt;BR /&gt;Imports Autodesk.AutoCAD.DatabaseServices&lt;BR /&gt;Imports Autodesk.AutoCAD.Runtime&lt;BR /&gt;Imports Autodesk.AutoCAD.EditorInput&lt;BR /&gt;Imports Autodesk.AutoCAD.Geometry&lt;/P&gt;&lt;P&gt;Namespace AutoCADObjectDataReader&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Public Class TemplateClass&lt;/P&gt;&lt;P&gt;&amp;lt;CommandMethod("ReadObjectData")&amp;gt;&lt;BR /&gt;Public Sub ReadObjectData()&lt;BR /&gt;Dim doc As Document = Application.DocumentManager.MdiActiveDocument&lt;BR /&gt;Dim db As Database = doc.Database&lt;BR /&gt;Dim ed As Editor = doc.Editor&lt;/P&gt;&lt;P&gt;'ed.WriteMessage("Starting" &amp;amp; vbCrLf)&lt;/P&gt;&lt;P&gt;Using tr As Transaction = db.TransactionManager.StartTransaction()&lt;BR /&gt;Dim bt As BlockTable = tr.GetObject(db.BlockTableId, OpenMode.ForRead)&lt;BR /&gt;Dim modelSpace As BlockTableRecord = tr.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForRead)&lt;BR /&gt;For Each entityID As ObjectId In modelSpace&lt;BR /&gt;Dim MyEntity As Entity = tr.GetObject(entityID, OpenMode.ForRead)&lt;BR /&gt;'Check If the entity has extended data&lt;BR /&gt;If (MyEntity IsNot Nothing AndAlso MyEntity.ExtensionDictionary.IsValid) Then&lt;BR /&gt;Dim extensionDict As DBDictionary = tr.GetObject(MyEntity.ExtensionDictionary, OpenMode.ForRead)&lt;BR /&gt;'Check If the entity's extension dictionary contains object data&lt;BR /&gt;If (extensionDict IsNot Nothing AndAlso extensionDict.Contains("ACAD_OBJECT_DATA")) Then&lt;BR /&gt;Dim MyxRecord As Xrecord = tr.GetObject(extensionDict.GetAt("ACAD_OBJECT_DATA"), OpenMode.ForRead)&lt;BR /&gt;'Check If the Xrecord Is valid And has data&lt;BR /&gt;If (MyxRecord IsNot Nothing AndAlso MyxRecord.Data IsNot Nothing) Then&lt;BR /&gt;Dim MyresultBuffer As ResultBuffer = MyxRecord.Data&lt;BR /&gt;Dim values As TypedValue() = MyresultBuffer.AsArray()&lt;BR /&gt;'Output the Object data To the console&lt;BR /&gt;'Dim value As TypedValue&lt;BR /&gt;For Each value As TypedValue In values&lt;BR /&gt;ed.WriteMessage(value.Value.ToString() &amp;amp; vbCrLf)&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;Else&lt;BR /&gt;ed.WriteMessage("MyxRecord is empty or not valid" &amp;amp; vbCrLf)&lt;BR /&gt;End If&lt;BR /&gt;Else&lt;BR /&gt;ed.WriteMessage("extensionDict is empty or not valid" &amp;amp; vbCrLf)&lt;BR /&gt;End If&lt;BR /&gt;Else&lt;BR /&gt;ed.WriteMessage("MyEntity is empty or not valid" &amp;amp; vbCrLf)&lt;BR /&gt;End If&lt;BR /&gt;Next&lt;BR /&gt;End Using&lt;/P&gt;&lt;P&gt;End Sub&lt;BR /&gt;End Class&lt;BR /&gt;End Namespace&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 06:47:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12106034#M8072</guid>
      <dc:creator>lee.morse</dc:creator>
      <dc:date>2023-07-17T06:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12106991#M8073</link>
      <description>&lt;P&gt;Firstly, please post the code by using the "&amp;lt;/&amp;gt;" button in the toolbar of the message window, so that the code will be more read-able.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are talking about "ObjectData" of AutoCAD Map 3D/Civil 3D, then, what makes you think that the ObjectData is stored with Entity.ExtensionDictionary?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, ObjectData is not stored with Entity.ExtensionDictionary. You should manuplate ObjectData with Map's .NET API by adding reference to ManagedMapApi.dll found in "C:\...[AutoCAD install folder]\Map" folder. Once you have this .NET assembly referenced, look into the namespace Autodesk.Gis.Map.ObjectData. You can also search for AutoCAD Map ObjectARX documentation and find sample code dealing with ObjectData.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 14:42:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12106991#M8073</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2023-07-17T14:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12107912#M8074</link>
      <description>&lt;P&gt;Hi Norman,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt;&amp;nbsp;wrote:&lt;/P&gt;&lt;P&gt;If you are talking about "ObjectData" of AutoCAD Map 3D/Civil 3D&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;Yes exactly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;You can also search for AutoCAD Map ObjectARX documentation and find sample code dealing with ObjectData.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I think herein lies the problem. I struggled to find any examples or documentation, maybe I just don't know my way around the website well enough. Is anyone able to post some links?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 22:04:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12107912#M8074</guid>
      <dc:creator>lee.morse</dc:creator>
      <dc:date>2023-07-17T22:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12107933#M8075</link>
      <description>&lt;P&gt;Samples for c# and VB.NET are installed here:&lt;/P&gt;
&lt;P&gt;C:\Program Files\Autodesk\AutoCAD 2024\Map\Development\Samples&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/MAP/2022/ENU/?guid=GUID-BE00A022-1DF7-4034-BEAB-3793089B1C8A" target="_blank" rel="noopener"&gt;Map3d Developer's guide&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.autodesk.com/developer-network/platform-technologies/autocad-map-3d" target="_blank" rel="noopener"&gt;ADN Platform Technologies&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 22:19:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12107933#M8075</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2023-07-17T22:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12107940#M8076</link>
      <description>&lt;P&gt;Well, I simply did a quick search online for "ObjectData in AutoCAD Map .NET API", it led me to this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.help/AutoCAD-Map-3D-2008-.NET-API/WS1a9193826455f5ffd8d87110dc58fdc8f-7af4.htm#:~:text=Object%20data%20provides%20a%20way%20of%20attaching%20additional,have%20a%20different%20way%20to%20handle%20feature%20properties." target="_blank" rel="noopener"&gt;https://documentation.help/AutoCAD-Map-3D-2008-.NET-API/WS1a9193826455f5ffd8d87110dc58fdc8f-7af4.htm#:~:text=Object%20data%20provides%20a%20way%20of%20attaching%20additional,have%20a%20different%20way%20to%20handle%20feature%20properties.&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While it is for AutoCAD Map 2008, all its contents are valid because AutoCAD Map .NET API remained unchanged since Acad Map2006 or 2007. This documentation has quite some code samples (unfortunately in VB.NET).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 22:24:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12107940#M8076</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2023-07-17T22:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12107944#M8077</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;the sample code you referred to is for Industrial Models, which is rarely/hardly used by anyone these days (or even many years ago) and do not deal with ObjectData.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 22:28:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12107944#M8077</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2023-07-17T22:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12107953#M8078</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9836010"&gt;@lee.morse&lt;/a&gt;&amp;nbsp;You can also search "&lt;A href="https://forums.autodesk.com/t5/autocad-map-3d-developer/bd-p/84" target="_blank" rel="noopener"&gt;AutoCAD Map 3d Developer&lt;/A&gt;" discussion forum for "ObjectData". You should find some sample code and maybe are interested in some past discussions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 22:32:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12107953#M8078</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2023-07-17T22:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12108436#M8079</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9836010"&gt;@lee.morse&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&lt;BR /&gt;Please attached drawing example&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 05:19:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12108436#M8079</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2023-07-18T05:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12132613#M8080</link>
      <description>&lt;P&gt;Hi hoseyalaa,&lt;/P&gt;&lt;P&gt;Sorry for the delayed reply, I have been on holiday, and I work a 7 on 7 off roster. I have attached a sample drawing.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 04:09:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12132613#M8080</guid>
      <dc:creator>lee.morse</dc:creator>
      <dc:date>2023-07-28T04:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12134264#M8081</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9836010"&gt;@lee.morse&lt;/a&gt;&amp;nbsp;Here is a chunk of code from a project of mine. It uses a WPF window so not everything here will make total sense but it should give you an idea of how to get the OD from an entity.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
using Autodesk.Gis.Map;
using Autodesk.Gis.Map.ObjectData;
using System;
using System.Collections.Generic;
using Constants = Autodesk.Gis.Map.Constants;
using MapOD = Autodesk.Gis.Map.ObjectData;


           var doc = Application.DocumentManager.MdiActiveDocument;
            var ed = doc.Editor;
            var db = doc.Database;
            var ssOpt = new PromptSelectionOptions();
            ssOpt.MessageForAdding = "\nSelect object to edit ObjectData:";
            ssOpt.SingleOnly = true;
            var ssFilter = new SelectionFilter(new TypedValue[] { new TypedValue(0, "*POLYLINE,LINE,INSERT,CIRCLE,ARC") });
            var ssRes = ed.GetSelection(ssOpt, ssFilter);
            if (ssRes.Status != PromptStatus.OK)
                return;
            ODDataWindow form = null;
            var tables = HostMapApplicationServices.Application.ActiveProject.ODTables;
            while (ssRes.Status == PromptStatus.OK)
            {
                ObjectId id = ssRes.Value.GetObjectIds()[0];
                using (var records = tables.GetObjectRecords(0, id, Constants.OpenMode.OpenForRead, true))
                {
                    if (records == null || records.Count &amp;lt; 1)
                    {
                        ed.WriteMessage("\nNo ObjectData attached to this entity, please select another.");
                        ssRes = ed.GetSelection(ssOpt, ssFilter);
                        continue;
                    }
                    mview = new ODModelView(records);
                    form = new ODDataWindow(mview);
                }
                if (Application.ShowModalWindow(form) == true)
                {
                    UpdateOD(id);
                }
                ssRes = ed.GetSelection(ssOpt, ssFilter);
            }
            mview = null;
&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 28 Jul 2023 19:11:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12134264#M8081</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2023-07-28T19:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12134271#M8082</link>
      <description>&lt;P&gt;And the constructor for the ViewModel which accepts the records as the argument:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;        public ODModelView(Records records)
        {
            System.IFormatProvider icInfo = System.Globalization.CultureInfo.InvariantCulture;
            var tables = HostMapApplicationServices.Application.ActiveProject.ODTables;
            var theData = new Dictionary&amp;lt;string, List&amp;lt;QuuxOData&amp;gt;&amp;gt;();
            EntityOD = new ObservableCollection&amp;lt;Dictionary&amp;lt;string, List&amp;lt;QuuxOData&amp;gt;&amp;gt;&amp;gt;();
            foreach (Record rec in records)
            {
                var tblname = rec.TableName;
                var defs = tables[tblname].FieldDefinitions;
                var tblData = new List&amp;lt;QuuxOData&amp;gt;();
                for (int i = 0; i &amp;lt; rec.Count; i++)
                {
                    var myod = new QuuxOData();
                    var fld = defs[i];
                    var entry = rec[i];
                    //myod.TableName = tblname;
                    myod.Name = fld.Name;
                    myod.DataType = entry.Type;
                    switch (entry.Type)
                    {
                        case Constants.DataType.Character:
                            myod.Value = entry.StrValue.ToUpper();
                            break;
                        case Constants.DataType.Integer:
                            myod.Value = entry.Int32Value;
                            break;
                        case Constants.DataType.Point:
                            myod.Value = entry.Point;
                            break;
                        case Constants.DataType.Real:
                            myod.Value = entry.DoubleValue;
                            break;
                    }
                    tblData.Add(myod);
                }
                theData.Add(tblname, tblData);
            }
            EntityOD.Add(theData);

        }
&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 28 Jul 2023 19:15:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12134271#M8082</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2023-07-28T19:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12134773#M8083</link>
      <description>&lt;P&gt;Hi Jeff,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. I have managed to grab the Projects ODTables. Where I am now getting stumped is trying to iterate through all the records from the table. This line of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;records = tables.GetObjectRecords(0, id, Constants.OpenMode.OpenForRead, true)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...seems very specifically for an object(s) with a known object id. How do I select and iterate through all objectData Records (I assume that I am allowed to have Records not attached to an Object)? I have browsed through the documentation here "&lt;A href="https://documentation.help/AutoCAD-Map-3D-2008-.NET-API/WS73099cc142f487551d92abb10dc573c45d-7bc0.htm&amp;quot;" target="_blank" rel="noopener"&gt;https://documentation.help/AutoCAD-Map-3D-2008-.NET-API/WS73099cc142f487551d92abb10dc573c45d-7bc0.htm"&lt;/A&gt; and cannot see a reference for how to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code so far. The commented sections clumsily indicate what I am trying to do (I think):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim acMapApp As MapApplication = HostMapApplicationServices.Application
Dim acActiveProject As Project.ProjectModel = acMapApp.ActiveProject
Dim acTableList As ObjectData.Tables = acActiveProject.ODTables
Dim odTableName As String
Dim odTable As ObjectData.Table


If (acTableList.TablesCount &amp;gt; 0) Then
                ed.WriteMessage("number of tables in table list = " + acTableList.TablesCount.ToString &amp;amp; vbCrLf)

                For Each odTableName In acTableList.GetTableNames()
                    ed.WriteMessage("Table Name = " &amp;amp; odTableName &amp;amp; vbCrLf)
                    odTable = acTableList.Item(odTableName)
                    Dim odFieldName As ObjectData.FieldDefinition
                    Dim odFieldDefs As ObjectData.FieldDefinitions = odTable.FieldDefinitions
                    Dim odRecord As ObjectData.Records
                    Dim odCount As Integer = odTable.FieldDefinitions.Count
                    'odRecord  = odTable.GetObjectTableRecords(0, id, Constants.OpenMode.OpenForRead, True)

                    ed.WriteMessage("Count of Fields: " &amp;amp; odCount &amp;amp; vbCrLf)

                    For i As Integer = 0 To odCount - 1
                        odFieldName = odFieldDefs.Item(i)

                        ed.WriteMessage(i &amp;amp; ":" &amp;amp; odFieldName.Name &amp;amp; vbCrLf)

                    Next


                    'For Each myRec As Record In odRecords
                    '    ed.WriteMessage("Records: " &amp;amp; myRec.Count &amp;amp; vbCrLf)
                    '    
                    '    ed.WriteMessage("Record Contents: " &amp;amp; myRec.ToString)
                    'Next

                Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies all if I am being painful.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jul 2023 05:27:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12134773#M8083</guid>
      <dc:creator>lee.morse</dc:creator>
      <dc:date>2023-07-29T05:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12135078#M8084</link>
      <description>&lt;P&gt;HI &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9836010"&gt;@lee.morse&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TRY&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;
[Autodesk.AutoCAD.Runtime.CommandMethodAttribute("ShowRecords")]
		public void CommandShowRecords()
		{
			try
			{
				Tables tables = HostMapApplicationServices.Application.ActiveProject.ODTables;

				
				if (tables.TablesCount &amp;lt; 1)
				{
					AcadEditor.WriteMessage("\n You have not created the ObjectData table, yet. ");
					return;
				}
				PromptSelectionOptions options = new PromptSelectionOptions();

				// Single select mode
				options.SingleOnly = true;
				options.SinglePickInSpace = true;
				options.MessageForAdding = "Select an entity:";
				AcadEditor.WriteMessage("\n Please select the target entity: ");
				PromptSelectionResult result = AcadEditor.GetSelection(options);

				if (result.Status != PromptStatus.OK)
				{
					AcadEditor.WriteMessage("\n User cancelled! ");
					return;
				}

				ObjectId[] ids = result.Value.GetObjectIds();
				if (ids.Length != 1)
				{
					AcadEditor.WriteMessage("\n Invalid selection! ");
					return;
				}

				if (!ShowObjectDataInfo(tables, ids[0]))
				{
					AcadEditor.WriteMessage("\n Failed to get the information from the entity. ");
				}
			}
			catch (System.Exception err)
			{
				AcadEditor.WriteMessage(err.Message);
			}
		}




		private static Editor AcadEditor
		{
			get
			{
				return Application.DocumentManager.MdiActiveDocument.Editor;
			}
		}


public bool ShowObjectDataInfo(Tables tables, ObjectId id)
		{
			ErrorCode errCode = ErrorCode.OK; 
			try
			{
				bool success = true;

				// Get and Initialize Records
				using (Records records
						   = tables.GetObjectRecords(0, id, Autodesk.Gis.Map.Constants.OpenMode.OpenForRead, false))
				{
					if (records.Count == 0)
					{
						AcadEditor.WriteMessage("\n There is no ObjectData record attached on the entity. ");
						return true;
					}

					int index = 0;

					// Iterate through all records
					foreach (Record record in records)
					{
						String msg = null;
						msg = String.Format("\nRecord {0} :  {1}", index , Environment.NewLine);
						index++;
						AcadEditor.WriteMessage(msg);

						// Get the table
						Autodesk.Gis.Map.ObjectData.Table table = tables[record.TableName];

						int valInt = 0;
						double valDouble = 0.0;
						string str = null;

						// Get record info
						for (int i = 0; i &amp;lt; record.Count; i++)
						{
							FieldDefinitions tableDef = table.FieldDefinitions;
							FieldDefinition column = null;
							column = tableDef[i];
							string colName = column.Name;
							MapValue val = record[i];

							switch (val.Type)
							{
                                case Autodesk.Gis.Map.Constants.DataType.Integer:
									valInt = val.Int32Value;
									msg = string.Format("{0} ", valInt);
									AcadEditor.WriteMessage(String.Format("{0}--&amp;gt; {1}{2}", colName, msg, Environment.NewLine));
									
									
									break;

                                case Autodesk.Gis.Map.Constants.DataType.Real:
									valDouble = val.DoubleValue;
									msg = string.Format("{0} ", valDouble);
									AcadEditor.WriteMessage(String.Format("{0}--&amp;gt; {1}{2}", colName, msg, Environment.NewLine));
									//AcadEditor.WriteMessage(msg);
									break;

                                case Autodesk.Gis.Map.Constants.DataType.Character:
									str = val.StrValue;
									msg = string.Format("{0} ", str);
									AcadEditor.WriteMessage(String.Format("{0}--&amp;gt; {1}{2}", colName, msg, Environment.NewLine));
									
									break;

                                case Autodesk.Gis.Map.Constants.DataType.Point:
								{
									Point3d pt = val.Point;
									double x = pt.X;
									double y = pt.Y;
									double z = pt.Z;
									msg = string.Format("Point({0},{1},{2}) ", x, y, z);
										AcadEditor.WriteMessage(String.Format("{0}----&amp;gt; {1}{2}", colName, msg, Environment.NewLine));
										
								}
									break;

								default:
									AcadEditor.WriteMessage("\nWrong data type\n");
									success = false;
									break;
							}
						}
					}
				}

				return success;
			}
			catch (MapException e)
			{
				errCode = (ErrorCode)(e.ErrorCode);
				// Deal with the exception here as your will

				return false;
			}
		}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture9.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1246682i069F178E79F416E8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture9.JPG" alt="Capture9.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jul 2023 07:56:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12135078#M8084</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2023-07-29T07:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12135689#M8085</link>
      <description>&lt;P&gt;Thank you hosneyalaa,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Great code that works well, however, as my above comment, this line of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;= tables.GetObjectRecords(0, id, Autodesk.Gis.Map.Constants.OpenMode.OpenForRead, false))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.. is for a specific object id. Is there a way to iterate through all objectData without the input of a specific object id?&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jul 2023 19:01:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12135689#M8085</guid>
      <dc:creator>lee.morse</dc:creator>
      <dc:date>2023-07-29T19:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12136479#M8086</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9836010"&gt;@lee.morse&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't understand you&lt;BR /&gt;Can you explain with pictures?&lt;BR /&gt;Do you want the code to Works with all elements in the drawing&lt;BR /&gt;without choosing&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jul 2023 11:34:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12136479#M8086</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2023-07-30T11:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trying To Read Object Data from a Civil3D drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12142102#M8087</link>
      <description>&lt;P&gt;Well, you can only iterate all Entities to get all ObjectData. So, yes, it is time-consuming process if the drawing has a lot of entities and only some of the entities have ObjectData record of particular ODTable attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 19:00:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trying-to-read-object-data-from-a-civil3d-drawing/m-p/12142102#M8087</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2023-08-01T19:00:26Z</dc:date>
    </item>
  </channel>
</rss>

