<?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: getting all XData of a selected entity in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/getting-all-xdata-of-a-selected-entity/m-p/12842724#M3593</link>
    <description>&lt;P&gt;Thank you _gile,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying (Googling and using ChatGPT) to get or develop a solution to retrieve all XData of a selected entity, but my code turned out to be quite long and convoluted. I didn't manage to find a direct and efficient way to do it, which is why I didn't post it here. I was sure that there was a more direct and straightforward solution.&lt;/P&gt;</description>
    <pubDate>Sun, 16 Jun 2024 15:14:25 GMT</pubDate>
    <dc:creator>_Bilal</dc:creator>
    <dc:date>2024-06-16T15:14:25Z</dc:date>
    <item>
      <title>getting all XData of a selected entity</title>
      <link>https://forums.autodesk.com/t5/net-forum/getting-all-xdata-of-a-selected-entity/m-p/12842463#M3589</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to get all XData of a selected entity using .NET&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 10:07:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getting-all-xdata-of-a-selected-entity/m-p/12842463#M3589</guid>
      <dc:creator>_Bilal</dc:creator>
      <dc:date>2024-06-16T10:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: getting all XData of a selected entity</title>
      <link>https://forums.autodesk.com/t5/net-forum/getting-all-xdata-of-a-selected-entity/m-p/12842471#M3590</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P data-unlink="true"&gt;The DBObject class (from which Entity is derived) has an &lt;A href="https://help.autodesk.com/view/OARX/2025/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_DBObject_XData" target="_blank" rel="noopener"&gt;XData property.&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 10:36:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getting-all-xdata-of-a-selected-entity/m-p/12842471#M3590</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2024-06-16T10:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: getting all XData of a selected entity</title>
      <link>https://forums.autodesk.com/t5/net-forum/getting-all-xdata-of-a-selected-entity/m-p/12842501#M3591</link>
      <description>&lt;P&gt;Thank you _gile,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually I am looking for .NET snippet like the one in autolisp (setq oXDlst (cdr (assoc -3 (entget (car (entsel)) '("*")))))&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 10:39:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getting-all-xdata-of-a-selected-entity/m-p/12842501#M3591</guid>
      <dc:creator>_Bilal</dc:creator>
      <dc:date>2024-06-16T10:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: getting all XData of a selected entity</title>
      <link>https://forums.autodesk.com/t5/net-forum/getting-all-xdata-of-a-selected-entity/m-p/12842696#M3592</link>
      <description>&lt;P&gt;You should post what you've written so far so that we can adapt a snippet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The C# "equivalent" to the (setq oXDlst (cdr (assoc -3 (entget (car (entsel)) '("*"))))) AutoLISP snippet, could be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;var doc = Application.DocumentManager.MdiActiveDocument;
var db = doc.Database;
var ed = doc.Editor;
var promptEntityResult = ed.GetEntity("\nSelect object: ");
ResultBuffer oXDlst = default;
if (promptEntityResult.Status == PromptStatus.OK)
{
    using (var tr = db.TransactionManager.StartTransaction())
    {
        var entity = tr.GetObject(promptEntityResult.ObjectId, OpenMode.ForRead);
        oXDlst = entity.XData;
        tr.Commit();
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 14:49:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getting-all-xdata-of-a-selected-entity/m-p/12842696#M3592</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2024-06-16T14:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: getting all XData of a selected entity</title>
      <link>https://forums.autodesk.com/t5/net-forum/getting-all-xdata-of-a-selected-entity/m-p/12842724#M3593</link>
      <description>&lt;P&gt;Thank you _gile,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying (Googling and using ChatGPT) to get or develop a solution to retrieve all XData of a selected entity, but my code turned out to be quite long and convoluted. I didn't manage to find a direct and efficient way to do it, which is why I didn't post it here. I was sure that there was a more direct and straightforward solution.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 15:14:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getting-all-xdata-of-a-selected-entity/m-p/12842724#M3593</guid>
      <dc:creator>_Bilal</dc:creator>
      <dc:date>2024-06-16T15:14:25Z</dc:date>
    </item>
  </channel>
</rss>

