<?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: Inserting block with attributes in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248962#M58120</link>
    <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ok, I tried ... and I understand your question now &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You donot have a problem defining the BlockDefinition by inserting data from an external DWG&lt;/P&gt;&lt;P&gt;Your problem is: when inserting the BlockReference into the modelspace the AttributeReferences are not generated automatically. And yes, that is by default, to get them inserted look to &lt;A target="_self" href="http://blog.civil3dreminders.com/2011/10/vbnet-insert-block-and-attributes.html"&gt;&amp;gt;&amp;gt;&amp;gt;this sample&amp;lt;&amp;lt;&amp;lt;&lt;/A&gt; .... especially the part with:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#666699" face="lucida sans unicode,lucida sans"&gt;ar.SetAttributeFromBlock(ad, blkRef.BlockTransform)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The AttRef's have to be created seperatly and attached to the BlockRef's AttributeCollection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck, - alfred -&lt;/P&gt;</description>
    <pubDate>Sat, 03 Dec 2011 15:18:47 GMT</pubDate>
    <dc:creator>Alfred.NESWADBA</dc:creator>
    <dc:date>2011-12-03T15:18:47Z</dc:date>
    <item>
      <title>Inserting block with attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248872#M58114</link>
      <description>&lt;P&gt;&lt;FONT size="3"&gt;I wish to insert a title sheet dwg, which has attribute definitions, as a block in another dwg.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;I can insert it, and if I explode it, the attribute definitions appear. Otherwise they are not added to the database.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;I am using standard code, which I can attach if it helps.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;it starts&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" face="arial,helvetica,sans-serif"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;Dim&lt;/FONT&gt;&lt;/FONT&gt; btr &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt;&lt;/FONT&gt; BlockTableRecord&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" face="arial,helvetica,sans-serif"&gt;..&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" face="arial,helvetica,sans-serif"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;Dim&lt;/FONT&gt;&lt;/FONT&gt; blk &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt;&lt;/FONT&gt; BlockReference = &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;New&lt;/FONT&gt;&lt;/FONT&gt; BlockReference(ip, blkid)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color="#008000"&gt;&lt;FONT color="#008000"&gt;'&amp;nbsp; insert block&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="arial,helvetica,sans-serif" size="3"&gt;&lt;FONT color="#008000"&gt;..&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" face="arial,helvetica,sans-serif"&gt;btr.AppendEntity(blk)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" face="arial,helvetica,sans-serif"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;If&lt;/FONT&gt;&lt;/FONT&gt; btr.HasAttributeDefinitions &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;Then&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" face="arial,helvetica,sans-serif"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp; For&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;Each&lt;/FONT&gt;&lt;/FONT&gt; attID &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt;&lt;/FONT&gt; ObjectId &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;In&lt;/FONT&gt;&lt;/FONT&gt; btr&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" size="3"&gt;&lt;FONT color="#008000"&gt;etc.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" size="3"&gt;&lt;FONT color="#008000"&gt;﻿&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;but btr.HasAttributeDefinitions = False&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;Please help?﻿&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2011 09:58:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248872#M58114</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-03T09:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting block with attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248874#M58115</link>
      <description>&lt;P&gt;ps. I have looked everywhere.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2011 09:59:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248874#M58115</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-03T09:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting block with attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248886#M58116</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you insert a BlockReference into a BlockTableRecord, the the BlockTableRecord will not hold AttributeDefinitions, you have not inserted multiple Objects, just added ONE BlockReference.&lt;/P&gt;&lt;P&gt;And you have no chance to get nested ones.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try in AutoCAD:&lt;/P&gt;&lt;P&gt;create one Block inluding a rectangle + one Attribute(definition) ==&amp;gt; call it TABLE&lt;/P&gt;&lt;P&gt;copy this Block(References) 5 times&lt;/P&gt;&lt;P&gt;create a new Block(Definition) TABLEGROUP out of these 5 BlockReferences and insert it anywhere in your drawing ==&amp;gt; the BlockReference TABLEGROUP does not show Attribute(References) to work with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2011 10:44:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248886#M58116</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2011-12-03T10:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting block with attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248942#M58117</link>
      <description>&lt;P&gt;Sorry, I don't understand your point.&lt;/P&gt;&lt;P&gt;I am using this code to insert a dwg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim btr As BlockTableRecord&lt;/P&gt;&lt;P&gt;Dim bt As BlockTable = DirectCast(tr.GetObject(CurDb.BlockTableId, OpenMode.ForRead), BlockTable)&lt;/P&gt;&lt;P&gt;Dim blkid As ObjectId&lt;/P&gt;&lt;P&gt;If Not bt.Has(Name) Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; btr = tr.GetObject(CurDb.CurrentSpaceId, OpenMode.ForWrite)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp; not already inserted?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim db As Database = New Database(False, True)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Using db&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; db.ReadDwgFile(Path, System.IO.FileShare.Read, False, "")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp; insert dwg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; blkid = CurDb.Insert(Name, db, True)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Using&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;btr = DirectCast(tr.GetObject(CurDb.CurrentSpaceId, OpenMode.ForWrite), BlockTableRecord)&lt;/P&gt;&lt;P&gt;If String.IsNullOrEmpty(btr.Name) Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; btr.UpgradeOpen()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; btr.Name = Name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; btr.DowngradeOpen()&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;Dim blk As BlockReference = New BlockReference(ip, blkid)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp; insert block&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand that the dwg's attributes may not be loaded into the database. So how do I do that?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2011 14:07:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248942#M58117</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-03T14:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting block with attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248946#M58118</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could you also attach/upload the drawing that you use for this statement&lt;/P&gt;&lt;P&gt;&lt;FONT color="#666699" face="lucida sans unicode,lucida sans"&gt;db.ReadDwgFile(Path, System.IO.FileShare.Read, False, "")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2011 14:44:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248946#M58118</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2011-12-03T14:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting block with attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248950#M58119</link>
      <description>&lt;P&gt;OK&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2011 14:46:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248950#M58119</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-03T14:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting block with attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248962#M58120</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ok, I tried ... and I understand your question now &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You donot have a problem defining the BlockDefinition by inserting data from an external DWG&lt;/P&gt;&lt;P&gt;Your problem is: when inserting the BlockReference into the modelspace the AttributeReferences are not generated automatically. And yes, that is by default, to get them inserted look to &lt;A target="_self" href="http://blog.civil3dreminders.com/2011/10/vbnet-insert-block-and-attributes.html"&gt;&amp;gt;&amp;gt;&amp;gt;this sample&amp;lt;&amp;lt;&amp;lt;&lt;/A&gt; .... especially the part with:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#666699" face="lucida sans unicode,lucida sans"&gt;ar.SetAttributeFromBlock(ad, blkRef.BlockTransform)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The AttRef's have to be created seperatly and attached to the BlockRef's AttributeCollection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck, - alfred -&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2011 15:18:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3248962#M58120</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2011-12-03T15:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting block with attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3249006#M58121</link>
      <description>&lt;P&gt;&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;Thanks for that.&lt;/P&gt;&lt;P&gt;I attach a text file showing my code as it seems to encapsulate all that I found out.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2011 17:52:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-block-with-attributes/m-p/3249006#M58121</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-03T17:52:52Z</dc:date>
    </item>
  </channel>
</rss>

