<?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 Adding custom metadata to Documents in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/adding-custom-metadata-to-documents/m-p/3840044#M50115</link>
    <description>&lt;P&gt;Hello again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder whether it is possible to add custom attirbutes to AutoCAD Documents. Like, when adding new key-value pairs to the OS registry. I see this as a function that can add a pair "attribute" =&amp;gt; "value" to the Document's database (or another saveable component) and later pull the "value" back by passing the "attribute" to another function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It wouldn't surprise me if this didn't exist but still why wondering when I can ask more experienced... Thanks.&lt;/P&gt;</description>
    <pubDate>Sun, 07 Apr 2013 19:02:07 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-04-07T19:02:07Z</dc:date>
    <item>
      <title>Adding custom metadata to Documents</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-custom-metadata-to-documents/m-p/3840044#M50115</link>
      <description>&lt;P&gt;Hello again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder whether it is possible to add custom attirbutes to AutoCAD Documents. Like, when adding new key-value pairs to the OS registry. I see this as a function that can add a pair "attribute" =&amp;gt; "value" to the Document's database (or another saveable component) and later pull the "value" back by passing the "attribute" to another function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It wouldn't surprise me if this didn't exist but still why wondering when I can ask more experienced... Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2013 19:02:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-custom-metadata-to-documents/m-p/3840044#M50115</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-07T19:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom metadata to Documents</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-custom-metadata-to-documents/m-p/3840618#M50116</link>
      <description>&lt;P&gt;I assume you want to add/attach some kind of data to the document/drawing, so the data get persisted inside the drawing file and can be accessed when the file is&amp;nbsp;loaded into AutoCAD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are at least 2 options you can look into, depending on the data you want to add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Drawing custom properties&lt;/P&gt;&lt;P&gt;2, Named dictionary&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both are key-value paired data sotrage mechanism. But to be aware, they can only be accessed to when the document is loaded into AutoCAD (or application based on RealDwg.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2013 13:47:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-custom-metadata-to-documents/m-p/3840618#M50116</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2013-04-08T13:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom metadata to Documents</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-custom-metadata-to-documents/m-p/3841036#M50117</link>
      <description>&lt;P&gt;Yes, that is what I am aiming to do. Since there was some digging and guessing involved in seeing how this works in ObjectARX 2013, I will add some code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Writing:&lt;/P&gt;&lt;PRE&gt;Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
DatabaseSummaryInfoBuilder infoBuilder = new DatabaseSummaryInfoBuilder();
infoBuilder.CustomPropertyTable["key1"] = "value1";
infoBuilder.CustomPropertyTable["key2"] = "value2";
doc.Database.SummaryInfo = infoBuilder.ToDatabaseSummaryInfo();
doc.Database.SaveAs("test.dwg", DwgVersion.Current);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Reading:&lt;/P&gt;&lt;PRE&gt;Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
DatabaseSummaryInfo info = db.SummaryInfo;
System.Collections.IDictionaryEnumerator cust = info.CustomProperties;
while(cust.MoveNext()) {
  string key = cust.Entry.Key as string;
  string value = cust.Entry.Value as string;
  // Write the pair wherever you want it for later, or just use it
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2013 18:07:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-custom-metadata-to-documents/m-p/3841036#M50117</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-08T18:07:33Z</dc:date>
    </item>
  </channel>
</rss>

