<?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: List of available blocks in a drawing using VBA in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/4840167#M14145</link>
    <description>&lt;P&gt;dm_salamania,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This seems interesting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you post a drawing that shows the original line and then the 3d I-BEAM AFTER conversion?&lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2014 07:51:32 GMT</pubDate>
    <dc:creator>sanganaksakha</dc:creator>
    <dc:date>2014-02-26T07:51:32Z</dc:date>
    <item>
      <title>List of available blocks in a drawing using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/2623850#M14139</link>
      <description>I need to populate a list box with a list of available blocks in my drawing, however it is listing every block in the drawing one entry for each instance of the block. example if block "A" is present 100 times I've got 100 "A"'s in my list. How can I correct this. Some of my code is attached below.&lt;BR /&gt;
&lt;BR /&gt;
   'collect up list of all acad objects&lt;BR /&gt;
    For Each ObjEnt In ThisDrawing.ModelSpace&lt;BR /&gt;
    'sort out blocks&lt;BR /&gt;
    If ObjEnt.ObjectName = "AcDbBlockReference" Then&lt;BR /&gt;
        Set ObjBRef = ObjEnt&lt;BR /&gt;
        CmbBx_Blk_Fnd_Nm.AddItem ObjBRef.EffectiveName</description>
      <pubDate>Thu, 28 Jan 2010 18:35:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/2623850#M14139</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-28T18:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: List of available blocks in a drawing using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/2623851#M14140</link>
      <description>Hi Steve,&lt;BR /&gt;
&lt;BR /&gt;
Read the help files till you understand the difference between&lt;BR /&gt;
&lt;BR /&gt;
AcadBlock&lt;BR /&gt;
&lt;BR /&gt;
and&lt;BR /&gt;
&lt;BR /&gt;
AcadBlockReference&lt;BR /&gt;
&lt;BR /&gt;
An AcadBlock cannot be found in model space&lt;BR /&gt;
&lt;BR /&gt;
An AcadBlockReference cannot be found in the drawings Blocks collection.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Laurie Comerford&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
steve030373 wrote:&lt;BR /&gt;
&amp;gt; I need to populate a list box with a list of available blocks in my drawing, however it is listing every block in the drawing one entry for each instance of the block. example if block "A" is present 100 times I've got 100 "A"'s in my list. How can I correct this. Some of my code is attached below.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;    'collect up list of all acad objects&lt;BR /&gt;
&amp;gt;     For Each ObjEnt In ThisDrawing.ModelSpace&lt;BR /&gt;
&amp;gt;     'sort out blocks&lt;BR /&gt;
&amp;gt;     If ObjEnt.ObjectName = "AcDbBlockReference" Then&lt;BR /&gt;
&amp;gt;         Set ObjBRef = ObjEnt&lt;BR /&gt;
&amp;gt;         CmbBx_Blk_Fnd_Nm.AddItem ObjBRef.EffectiveName&lt;BR /&gt;
&amp;gt;</description>
      <pubDate>Thu, 28 Jan 2010 18:52:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/2623851#M14140</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-28T18:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: List of available blocks in a drawing using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/2623852#M14141</link>
      <description>Once you have followed Laurie's advice you may use this:&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
Private Sub CommandButton1_Click()&lt;BR /&gt;
&lt;BR /&gt;
Dim B As AcadBlocks&lt;BR /&gt;
Dim i As Integer&lt;BR /&gt;
Set B = ThisDrawing.Blocks&lt;BR /&gt;
For i = 0 To B.Count - 1&lt;BR /&gt;
  ListBox1.AddItem B(i).Name&lt;BR /&gt;
Next i&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Mario</description>
      <pubDate>Mon, 08 Feb 2010 04:10:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/2623852#M14141</guid>
      <dc:creator>Mario-Villada</dc:creator>
      <dc:date>2010-02-08T04:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: List of available blocks in a drawing using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/4818889#M14142</link>
      <description>&lt;P&gt;Mr. steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can i get you code in "&amp;nbsp;list of available blocks in a drawing using VBA&amp;nbsp;"&lt;/P&gt;&lt;P&gt;i have also problem in this situation..&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2014 15:16:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/4818889#M14142</guid>
      <dc:creator>dm_salamania</dc:creator>
      <dc:date>2014-02-16T15:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: List of available blocks in a drawing using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/4819957#M14143</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the last post abive yours show how to collect the block-definitions from the drawing, what do you need more than that (or other than that)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2014 11:59:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/4819957#M14143</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2014-02-17T11:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: List of available blocks in a drawing using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/4820253#M14144</link>
      <description>&lt;P&gt;Sir Good day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I'm new in vba. I want to make a VBA in Autocad that can make the simple LINE into a 3d I-BEAM in just a single click.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PLease see attached file.that is the form of my VBA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me Sir.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2014 14:32:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/4820253#M14144</guid>
      <dc:creator>dm_salamania</dc:creator>
      <dc:date>2014-02-17T14:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: List of available blocks in a drawing using VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/4840167#M14145</link>
      <description>&lt;P&gt;dm_salamania,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This seems interesting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you post a drawing that shows the original line and then the 3d I-BEAM AFTER conversion?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2014 07:51:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/list-of-available-blocks-in-a-drawing-using-vba/m-p/4840167#M14145</guid>
      <dc:creator>sanganaksakha</dc:creator>
      <dc:date>2014-02-26T07:51:32Z</dc:date>
    </item>
  </channel>
</rss>

