<?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 CreateExtensionDictionary to blockreference in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/createextensiondictionary-to-blockreference/m-p/1773672#M80307</link>
    <description>I'm trying to create an extension dictionary for a blockreference but autocad tall me eNoDatabase&lt;BR /&gt;
&lt;BR /&gt;
here is the code&lt;BR /&gt;
&lt;BR /&gt;
       Dim db As Database = HostApplicationServices.WorkingDatabase&lt;BR /&gt;
        Dim trans As Transaction = db.TransactionManager.StartTransaction()&lt;BR /&gt;
        Dim bt As BlockTable = trans.GetObject(db.BlockTableId, OpenMode.ForWrite)&lt;BR /&gt;
        Dim btr As BlockTableRecord = trans.GetObject(bt.Item(BlockTableRecord.ModelSpace), OpenMode.ForWrite)&lt;BR /&gt;
        Dim newBtrId As ObjectId = CreateEmployeeDefinition()&lt;BR /&gt;
        Dim br As BlockReference = New BlockReference(New Point3d(10, 10, 0), newBtrId)&lt;BR /&gt;
        Dim brExtDict As DBDictionary&lt;BR /&gt;
&lt;BR /&gt;
        Dim name As Xrecord = New Xrecord&lt;BR /&gt;
        Dim salary As Xrecord = New Xrecord&lt;BR /&gt;
        Dim division As Xrecord = New Xrecord&lt;BR /&gt;
&lt;BR /&gt;
        name.Data = New ResultBuffer(New TypedValue(DxfCode.Text, "Earnest Shackleton"))&lt;BR /&gt;
        salary.Data = New ResultBuffer(New TypedValue(DxfCode.Real, 7200))&lt;BR /&gt;
        division.Data = New ResultBuffer(New TypedValue(DxfCode.Text, "Sales"))&lt;BR /&gt;
&lt;BR /&gt;
        ' Se cae al tratar de crear el diccionario para el blockreference&lt;BR /&gt;
&lt;BR /&gt;
        br.CreateExtensionDictionary()&lt;BR /&gt;
&lt;BR /&gt;
the last line is where crash the code,&lt;BR /&gt;
any help it's good recived</description>
    <pubDate>Mon, 25 Sep 2006 19:54:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-09-25T19:54:36Z</dc:date>
    <item>
      <title>CreateExtensionDictionary to blockreference</title>
      <link>https://forums.autodesk.com/t5/net-forum/createextensiondictionary-to-blockreference/m-p/1773672#M80307</link>
      <description>I'm trying to create an extension dictionary for a blockreference but autocad tall me eNoDatabase&lt;BR /&gt;
&lt;BR /&gt;
here is the code&lt;BR /&gt;
&lt;BR /&gt;
       Dim db As Database = HostApplicationServices.WorkingDatabase&lt;BR /&gt;
        Dim trans As Transaction = db.TransactionManager.StartTransaction()&lt;BR /&gt;
        Dim bt As BlockTable = trans.GetObject(db.BlockTableId, OpenMode.ForWrite)&lt;BR /&gt;
        Dim btr As BlockTableRecord = trans.GetObject(bt.Item(BlockTableRecord.ModelSpace), OpenMode.ForWrite)&lt;BR /&gt;
        Dim newBtrId As ObjectId = CreateEmployeeDefinition()&lt;BR /&gt;
        Dim br As BlockReference = New BlockReference(New Point3d(10, 10, 0), newBtrId)&lt;BR /&gt;
        Dim brExtDict As DBDictionary&lt;BR /&gt;
&lt;BR /&gt;
        Dim name As Xrecord = New Xrecord&lt;BR /&gt;
        Dim salary As Xrecord = New Xrecord&lt;BR /&gt;
        Dim division As Xrecord = New Xrecord&lt;BR /&gt;
&lt;BR /&gt;
        name.Data = New ResultBuffer(New TypedValue(DxfCode.Text, "Earnest Shackleton"))&lt;BR /&gt;
        salary.Data = New ResultBuffer(New TypedValue(DxfCode.Real, 7200))&lt;BR /&gt;
        division.Data = New ResultBuffer(New TypedValue(DxfCode.Text, "Sales"))&lt;BR /&gt;
&lt;BR /&gt;
        ' Se cae al tratar de crear el diccionario para el blockreference&lt;BR /&gt;
&lt;BR /&gt;
        br.CreateExtensionDictionary()&lt;BR /&gt;
&lt;BR /&gt;
the last line is where crash the code,&lt;BR /&gt;
any help it's good recived</description>
      <pubDate>Mon, 25 Sep 2006 19:54:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/createextensiondictionary-to-blockreference/m-p/1773672#M80307</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-25T19:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: CreateExtensionDictionary to blockreference</title>
      <link>https://forums.autodesk.com/t5/net-forum/createextensiondictionary-to-blockreference/m-p/1773673#M80308</link>
      <description>I've not tested but think that you must add br to btr before br.CreateExtensionDictionary()</description>
      <pubDate>Mon, 25 Sep 2006 22:04:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/createextensiondictionary-to-blockreference/m-p/1773673#M80308</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-25T22:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: CreateExtensionDictionary to blockreference</title>
      <link>https://forums.autodesk.com/t5/net-forum/createextensiondictionary-to-blockreference/m-p/1773674#M80309</link>
      <description>Thanks a lot i thonk the same during the night &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 26 Sep 2006 13:32:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/createextensiondictionary-to-blockreference/m-p/1773674#M80309</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-26T13:32:34Z</dc:date>
    </item>
  </channel>
</rss>

