<?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: Insert block from memory in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/insert-block-from-memory/m-p/1661365#M33956</link>
    <description>You check AcadDocument.Blocks collection to see if the block definition is &lt;BR /&gt;
already in drawing or not:&lt;BR /&gt;
&lt;BR /&gt;
Dim blk As AcadBlock&lt;BR /&gt;
Dim bolExist As Boolean&lt;BR /&gt;
For Each blk In ThisDrawing.Blocks&lt;BR /&gt;
    If UCase(blk.Name)=Ucase(theBlockName) THEN&lt;BR /&gt;
        bolExist=True&lt;BR /&gt;
        Exit For&lt;BR /&gt;
    End&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
If bolExist Then&lt;BR /&gt;
    ''Do insertion by passing BlockName&lt;BR /&gt;
    ThisDrawing.ModelSpance.InsertBlock theBlockName,....&lt;BR /&gt;
Else&lt;BR /&gt;
    ''Do insertion by passing full block file name&lt;BR /&gt;
    ThisDrawing.ModelSpace.InsertBlock "\\TheServer\BlockLibrary\" &amp;amp; &lt;BR /&gt;
theBlockName &amp;amp; ".dwg",....&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
&lt;PIERRED&gt; wrote in message news:5192143@discussion.autodesk.com...&lt;BR /&gt;
Hi!&lt;BR /&gt;
I have a VBA program that insert many copy of a block. I would like to know &lt;BR /&gt;
how I can check if the block is already in the drawing and if it is use the &lt;BR /&gt;
same block.&lt;BR /&gt;
&lt;BR /&gt;
if blockxxx is in memory&lt;BR /&gt;
insert from memory&lt;BR /&gt;
else&lt;BR /&gt;
insert from the server&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
Right now my program takes 30 seconds to execute, I have 395 "duplicate &lt;BR /&gt;
definition of block _archtik ignored"&lt;BR /&gt;
&lt;BR /&gt;
Thx!&lt;/PIERRED&gt;</description>
    <pubDate>Thu, 01 Jun 2006 14:42:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-06-01T14:42:20Z</dc:date>
    <item>
      <title>Insert block from memory</title>
      <link>https://forums.autodesk.com/t5/vba-forum/insert-block-from-memory/m-p/1661364#M33955</link>
      <description>Hi!&lt;BR /&gt;
I have a VBA program that insert many copy of a block. I would like to know how I can check if the block is already in the drawing and if it is use the same block.&lt;BR /&gt;
&lt;BR /&gt;
if blockxxx is in memory&lt;BR /&gt;
insert from memory&lt;BR /&gt;
else&lt;BR /&gt;
insert from the server&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
Right now my program takes 30 seconds to execute, I have 395 "duplicate definition of block _archtik ignored"&lt;BR /&gt;
&lt;BR /&gt;
Thx!</description>
      <pubDate>Thu, 01 Jun 2006 14:13:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/insert-block-from-memory/m-p/1661364#M33955</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-01T14:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Insert block from memory</title>
      <link>https://forums.autodesk.com/t5/vba-forum/insert-block-from-memory/m-p/1661365#M33956</link>
      <description>You check AcadDocument.Blocks collection to see if the block definition is &lt;BR /&gt;
already in drawing or not:&lt;BR /&gt;
&lt;BR /&gt;
Dim blk As AcadBlock&lt;BR /&gt;
Dim bolExist As Boolean&lt;BR /&gt;
For Each blk In ThisDrawing.Blocks&lt;BR /&gt;
    If UCase(blk.Name)=Ucase(theBlockName) THEN&lt;BR /&gt;
        bolExist=True&lt;BR /&gt;
        Exit For&lt;BR /&gt;
    End&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
If bolExist Then&lt;BR /&gt;
    ''Do insertion by passing BlockName&lt;BR /&gt;
    ThisDrawing.ModelSpance.InsertBlock theBlockName,....&lt;BR /&gt;
Else&lt;BR /&gt;
    ''Do insertion by passing full block file name&lt;BR /&gt;
    ThisDrawing.ModelSpace.InsertBlock "\\TheServer\BlockLibrary\" &amp;amp; &lt;BR /&gt;
theBlockName &amp;amp; ".dwg",....&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
&lt;PIERRED&gt; wrote in message news:5192143@discussion.autodesk.com...&lt;BR /&gt;
Hi!&lt;BR /&gt;
I have a VBA program that insert many copy of a block. I would like to know &lt;BR /&gt;
how I can check if the block is already in the drawing and if it is use the &lt;BR /&gt;
same block.&lt;BR /&gt;
&lt;BR /&gt;
if blockxxx is in memory&lt;BR /&gt;
insert from memory&lt;BR /&gt;
else&lt;BR /&gt;
insert from the server&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
Right now my program takes 30 seconds to execute, I have 395 "duplicate &lt;BR /&gt;
definition of block _archtik ignored"&lt;BR /&gt;
&lt;BR /&gt;
Thx!&lt;/PIERRED&gt;</description>
      <pubDate>Thu, 01 Jun 2006 14:42:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/insert-block-from-memory/m-p/1661365#M33956</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-01T14:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Insert block from memory</title>
      <link>https://forums.autodesk.com/t5/vba-forum/insert-block-from-memory/m-p/1661366#M33957</link>
      <description>Thx Norman, I will give it a try!&lt;BR /&gt;
&lt;BR /&gt;
Pierre D.</description>
      <pubDate>Thu, 01 Jun 2006 14:48:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/insert-block-from-memory/m-p/1661366#M33957</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-01T14:48:16Z</dc:date>
    </item>
  </channel>
</rss>

