<?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: Get all BlockReferences in database in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10407796#M16035</link>
    <description>&lt;P&gt;Our shop's CNC mill isn't capable of reading blocks, only geometric entities. Our current export function creates a new drawing for each selected block, recreates it there, and then tries to explode it so the mill can properly read its files - right now we have to explode each new drawing manually, but doing so does achieve the results we want.&lt;/P&gt;&lt;P&gt;Tyler&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jun 2021 13:08:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-06-21T13:08:37Z</dc:date>
    <item>
      <title>Get all BlockReferences in database</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10402100#M16033</link>
      <description>&lt;P&gt;Hi, just trying to find an efficient way of retrieving blockreferences from a drawing's database so I can explode them. Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;Tyler&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 18:26:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10402100#M16033</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-18T18:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Get all BlockReferences in database</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10402304#M16034</link>
      <description>&lt;P&gt;That sounds like a horrible thing to want to do, and why I like to make exploding blocks difficult to do. You make have to go into all the blocks and set to allow exploding. You may be able to use qselect to then to select all blocks the explode. But I can't think of a good reason to destroy your drawing in that way. Just for discussion why do you want to do this.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 19:44:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10402304#M16034</guid>
      <dc:creator>jtohill</dc:creator>
      <dc:date>2021-06-18T19:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Get all BlockReferences in database</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10407796#M16035</link>
      <description>&lt;P&gt;Our shop's CNC mill isn't capable of reading blocks, only geometric entities. Our current export function creates a new drawing for each selected block, recreates it there, and then tries to explode it so the mill can properly read its files - right now we have to explode each new drawing manually, but doing so does achieve the results we want.&lt;/P&gt;&lt;P&gt;Tyler&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 13:08:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10407796#M16035</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-21T13:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get all BlockReferences in database</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10408014#M16036</link>
      <description>&lt;P&gt;That's a better answer, try this.plot a pdf of the drawing after turning off all linework you don't need. inport the pdf using the pdf import tool. you may have to explode any plines, but this should give you a drawing without blocks, just linework.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 14:05:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10408014#M16036</guid>
      <dc:creator>jtohill</dc:creator>
      <dc:date>2021-06-21T14:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get all BlockReferences in database</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10408018#M16037</link>
      <description>&lt;P&gt;inport into an new drawing.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 14:06:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10408018#M16037</guid>
      <dc:creator>jtohill</dc:creator>
      <dc:date>2021-06-21T14:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get all BlockReferences in database</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10408371#M16038</link>
      <description>&lt;P&gt;will that preserve the layer names of the entities? In SCM Maestro the machine reads a .dxf file's layer names to determine the proper tool to use.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 15:45:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10408371#M16038</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-21T15:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Get all BlockReferences in database</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10408398#M16039</link>
      <description>&lt;P&gt;no it creates it's own layers.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 15:51:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10408398#M16039</guid>
      <dc:creator>jtohill</dc:creator>
      <dc:date>2021-06-21T15:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get all BlockReferences in database</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10408404#M16040</link>
      <description>&lt;P&gt;Then that solution unfortunately isn't going to work for me... Exploding still seems like the most viable path here&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 15:53:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10408404#M16040</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-21T15:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Get all BlockReferences in database</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10409241#M16041</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, just trying to find an efficient way of retrieving blockreferences from a drawing's database ...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When you asking "&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;EM&gt;an efficient way...&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;", it sounds like you tried it in some way, but thought it was not efficient. You may want to explain what does "efficient" mean here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a few ways to find BlockReferences in a drawing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;1. You can use Editor.SelectAll(), or other Editor.SelectXXXX() method with filter to only have block references selected;&lt;/P&gt;
&lt;P&gt;2. You can open ModelSpace and each PaperSpace&amp;nbsp; and loop through it and only deal with entities in the Model/PaperSpace, if the entity is BlockReferemce;&lt;/P&gt;
&lt;P&gt;3. You can loop through each BlockTableRecord in BlockTable that is not a Layout block. Then for each BlockTableRecord, you call its GetBlockReferneceIds()/GetAnonymousBlockReferenceIds() to get all block references of a given BlockTableRecord.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless your drawing is super huge (containing millions of entities), any of the afore-mentioned approaches would not have much of difference in terms of "efficient way" of finding block references in a drawing, a fraction of second, or a second or 2 (does it really matter in your case?).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 21:41:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10409241#M16041</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2021-06-21T21:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Get all BlockReferences in database</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10411914#M16042</link>
      <description>&lt;P&gt;Thanks so much, this helped a ton!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 18:07:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-all-blockreferences-in-database/m-p/10411914#M16042</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-22T18:07:43Z</dc:date>
    </item>
  </channel>
</rss>

