<?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: Read all Block in C# in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537876#M69443</link>
    <description>Mario - If you don't get many answers here, it is probably because&lt;BR /&gt;
this newsgroup is focused on using the managed ObjectARX API,&lt;BR /&gt;
rather than the ActiveX API that's used by legacy VB and VBA.&lt;BR /&gt;
&lt;BR /&gt;
I'm not suggesting you not post here, but ActiveX API usage is&lt;BR /&gt;
the focus of the VBA newsgroups, and you would probably get&lt;BR /&gt;
more/quicker answers there (if for no other reason, because it&lt;BR /&gt;
has far more readers than this newsgroup).&lt;BR /&gt;
&lt;BR /&gt;
The newsgroups are more 'API-centric' than 'language-centric'.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;TEIMAR71&gt; wrote in message news:6234760@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
i'm new in here and new in programming AutoCAD in C#. I've been developing &lt;BR /&gt;
C# for 5 years but writing a program for AutoCAD is new challenge.&lt;BR /&gt;
&lt;BR /&gt;
I want to read all blocks from an AutoCAD dwg including the attributes. &lt;BR /&gt;
(Hint: AutoCAD 2008 and VS.NET 2008!)&lt;BR /&gt;
&lt;BR /&gt;
Is there a way to read all blocks (and attributes) without a SelectionSet?&lt;BR /&gt;
&lt;BR /&gt;
Here is a small code sample. This sample is compileable and runable, but i &lt;BR /&gt;
don't get any blockreference from the selectionset!&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
Mario&lt;BR /&gt;
&lt;BR /&gt;
AcadApplication acadApplication = null;&lt;BR /&gt;
AcadDocument acadDocument = null;&lt;BR /&gt;
AcadSelectionSet acadSelectionSet = null;&lt;BR /&gt;
AcadAttribute[] acadAttributes = null;&lt;BR /&gt;
&lt;BR /&gt;
Int16[] filterType = new Int16[]{0};&lt;BR /&gt;
object[] filterData = new object[] { "Insert" };&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
try&lt;BR /&gt;
{&lt;BR /&gt;
acadApplication = &lt;BR /&gt;
(AcadApplication)Marshal.GetActiveObject("AutoCAD.Application");&lt;BR /&gt;
}&lt;BR /&gt;
catch&lt;BR /&gt;
{&lt;BR /&gt;
acadApplication = new AcadApplication();&lt;BR /&gt;
}&lt;BR /&gt;
acadApplication.Visible = false;&lt;BR /&gt;
acadDocument = acadApplication.Documents.Add("c:\\temp\\test.dwg");&lt;BR /&gt;
&lt;BR /&gt;
acadSelectionSet = acadDocument.SelectionSets.Add("sel1");&lt;BR /&gt;
acadSelectionSet.Select(AcSelect.acSelectionSetAll, Type.Missing, &lt;BR /&gt;
Type.Missing, filterType, filterData);&lt;BR /&gt;
&lt;BR /&gt;
foreach (AcadBlockReference blockReference in acadSelectionSet)&lt;BR /&gt;
{&lt;BR /&gt;
acadAttributes = blockReference.GetAttributes() as AcadAttribute[];&lt;BR /&gt;
foreach(AcadAttribute attr in acadAttributes)&lt;BR /&gt;
{&lt;BR /&gt;
switch( attr.TagString)&lt;BR /&gt;
{&lt;BR /&gt;
...&lt;BR /&gt;
}&lt;BR /&gt;
}&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
Edited by: TeiMar71 on Aug 11, 2009 2:17 PM&lt;/TEIMAR71&gt;</description>
    <pubDate>Wed, 12 Aug 2009 13:29:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-08-12T13:29:44Z</dc:date>
    <item>
      <title>Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537872#M69439</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
i'm new in here and new in programming AutoCAD in C#. I've been developing C# for 5 years but writing a program for AutoCAD is new challenge.&lt;BR /&gt;
&lt;BR /&gt;
I want to read all blocks from an AutoCAD dwg including the attributes. (Hint: AutoCAD 2008 and VS.NET 2008!)&lt;BR /&gt;
&lt;BR /&gt;
Is there a way to read all blocks (and attributes) without a SelectionSet?&lt;BR /&gt;
&lt;BR /&gt;
Here is a small code sample. This sample is compileable and runable, but i don't get any blockreference from the selectionset!&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
Mario&lt;BR /&gt;
&lt;BR /&gt;
			AcadApplication acadApplication = null;&lt;BR /&gt;
			AcadDocument acadDocument = null;&lt;BR /&gt;
			AcadSelectionSet acadSelectionSet = null;&lt;BR /&gt;
			AcadAttribute[] acadAttributes = null;&lt;BR /&gt;
&lt;BR /&gt;
			Int16[] filterType = new Int16[]{0};&lt;BR /&gt;
			object[] filterData = new object[] { "Insert" };&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
			try&lt;BR /&gt;
			{&lt;BR /&gt;
				acadApplication = (AcadApplication)Marshal.GetActiveObject("AutoCAD.Application");&lt;BR /&gt;
			}&lt;BR /&gt;
			catch&lt;BR /&gt;
			{&lt;BR /&gt;
				acadApplication = new AcadApplication();&lt;BR /&gt;
			}&lt;BR /&gt;
			acadApplication.Visible = false;&lt;BR /&gt;
			acadDocument = acadApplication.Documents.Add("c:\\temp\\test.dwg");&lt;BR /&gt;
			&lt;BR /&gt;
			acadSelectionSet = acadDocument.SelectionSets.Add("sel1");&lt;BR /&gt;
			acadSelectionSet.Select(AcSelect.acSelectionSetAll, Type.Missing, Type.Missing, filterType, filterData);&lt;BR /&gt;
&lt;BR /&gt;
			foreach (AcadBlockReference blockReference in acadSelectionSet)&lt;BR /&gt;
			{&lt;BR /&gt;
				acadAttributes = blockReference.GetAttributes() as AcadAttribute[];&lt;BR /&gt;
				foreach(AcadAttribute attr in acadAttributes)&lt;BR /&gt;
				{&lt;BR /&gt;
					switch( attr.TagString)&lt;BR /&gt;
					{&lt;BR /&gt;
						...&lt;BR /&gt;
					}&lt;BR /&gt;
				}&lt;BR /&gt;
			}

Edited by: TeiMar71 on Aug 11, 2009 2:17 PM</description>
      <pubDate>Tue, 11 Aug 2009 08:35:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537872#M69439</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-11T08:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537873#M69440</link>
      <description>Can nobody answer this question ?????????</description>
      <pubDate>Wed, 12 Aug 2009 09:29:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537873#M69440</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-12T09:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537874#M69441</link>
      <description>Open the drawing you want instead of adding a new drawing which would be &lt;BR /&gt;
blank.&lt;BR /&gt;
acadDocument = &lt;BR /&gt;
acadApplication.Documents.Open("c:\\test.dwg",true,Type.Missing);&lt;BR /&gt;
&lt;BR /&gt;
&lt;TEIMAR71&gt; wrote in message news:6235578@discussion.autodesk.com...&lt;BR /&gt;
Can nobody answer this question ?????????&lt;/TEIMAR71&gt;</description>
      <pubDate>Wed, 12 Aug 2009 10:33:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537874#M69441</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-12T10:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537875#M69442</link>
      <description>cool .. thanx ... that's it!&lt;BR /&gt;
&lt;BR /&gt;
now i'm hanging at this line :&lt;BR /&gt;
acadAttributes = blockReference.GetAttributes() as AcadAttribute[];&lt;BR /&gt;
&lt;BR /&gt;
but that's another prob!&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
Mario</description>
      <pubDate>Wed, 12 Aug 2009 11:38:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537875#M69442</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-12T11:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537876#M69443</link>
      <description>Mario - If you don't get many answers here, it is probably because&lt;BR /&gt;
this newsgroup is focused on using the managed ObjectARX API,&lt;BR /&gt;
rather than the ActiveX API that's used by legacy VB and VBA.&lt;BR /&gt;
&lt;BR /&gt;
I'm not suggesting you not post here, but ActiveX API usage is&lt;BR /&gt;
the focus of the VBA newsgroups, and you would probably get&lt;BR /&gt;
more/quicker answers there (if for no other reason, because it&lt;BR /&gt;
has far more readers than this newsgroup).&lt;BR /&gt;
&lt;BR /&gt;
The newsgroups are more 'API-centric' than 'language-centric'.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;TEIMAR71&gt; wrote in message news:6234760@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
i'm new in here and new in programming AutoCAD in C#. I've been developing &lt;BR /&gt;
C# for 5 years but writing a program for AutoCAD is new challenge.&lt;BR /&gt;
&lt;BR /&gt;
I want to read all blocks from an AutoCAD dwg including the attributes. &lt;BR /&gt;
(Hint: AutoCAD 2008 and VS.NET 2008!)&lt;BR /&gt;
&lt;BR /&gt;
Is there a way to read all blocks (and attributes) without a SelectionSet?&lt;BR /&gt;
&lt;BR /&gt;
Here is a small code sample. This sample is compileable and runable, but i &lt;BR /&gt;
don't get any blockreference from the selectionset!&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
Mario&lt;BR /&gt;
&lt;BR /&gt;
AcadApplication acadApplication = null;&lt;BR /&gt;
AcadDocument acadDocument = null;&lt;BR /&gt;
AcadSelectionSet acadSelectionSet = null;&lt;BR /&gt;
AcadAttribute[] acadAttributes = null;&lt;BR /&gt;
&lt;BR /&gt;
Int16[] filterType = new Int16[]{0};&lt;BR /&gt;
object[] filterData = new object[] { "Insert" };&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
try&lt;BR /&gt;
{&lt;BR /&gt;
acadApplication = &lt;BR /&gt;
(AcadApplication)Marshal.GetActiveObject("AutoCAD.Application");&lt;BR /&gt;
}&lt;BR /&gt;
catch&lt;BR /&gt;
{&lt;BR /&gt;
acadApplication = new AcadApplication();&lt;BR /&gt;
}&lt;BR /&gt;
acadApplication.Visible = false;&lt;BR /&gt;
acadDocument = acadApplication.Documents.Add("c:\\temp\\test.dwg");&lt;BR /&gt;
&lt;BR /&gt;
acadSelectionSet = acadDocument.SelectionSets.Add("sel1");&lt;BR /&gt;
acadSelectionSet.Select(AcSelect.acSelectionSetAll, Type.Missing, &lt;BR /&gt;
Type.Missing, filterType, filterData);&lt;BR /&gt;
&lt;BR /&gt;
foreach (AcadBlockReference blockReference in acadSelectionSet)&lt;BR /&gt;
{&lt;BR /&gt;
acadAttributes = blockReference.GetAttributes() as AcadAttribute[];&lt;BR /&gt;
foreach(AcadAttribute attr in acadAttributes)&lt;BR /&gt;
{&lt;BR /&gt;
switch( attr.TagString)&lt;BR /&gt;
{&lt;BR /&gt;
...&lt;BR /&gt;
}&lt;BR /&gt;
}&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
Edited by: TeiMar71 on Aug 11, 2009 2:17 PM&lt;/TEIMAR71&gt;</description>
      <pubDate>Wed, 12 Aug 2009 13:29:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537876#M69443</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-12T13:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537877#M69444</link>
      <description>{code}&lt;BR /&gt;
foreach (AcadBlockReference blockReference in acadSelectionSet)&lt;BR /&gt;
{&lt;BR /&gt;
    object[] atts = (object[]) blockReference.GetAttributes();&lt;BR /&gt;
    foreach( AcadAttributeReference att in atts )&lt;BR /&gt;
    {&lt;BR /&gt;
        Debug.Print(att.TagString);&lt;BR /&gt;
    }&lt;BR /&gt;
}&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
&lt;TEIMAR71&gt; wrote in message news:6235615@discussion.autodesk.com...&lt;BR /&gt;
cool .. thanx ... that's it!&lt;BR /&gt;
&lt;BR /&gt;
now i'm hanging at this line :&lt;BR /&gt;
acadAttributes = blockReference.GetAttributes() as AcadAttribute[];&lt;BR /&gt;
&lt;BR /&gt;
but that's another prob!&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
Mario&lt;/TEIMAR71&gt;</description>
      <pubDate>Wed, 12 Aug 2009 13:48:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537877#M69444</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-12T13:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537878#M69445</link>
      <description>Thanx Paul ... that works!</description>
      <pubDate>Wed, 12 Aug 2009 13:52:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537878#M69445</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-12T13:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537879#M69446</link>
      <description>Thanx Tony ... i understand!&lt;BR /&gt;
&lt;BR /&gt;
I tried to reference to the managed DLLs (acdbmgd.dll and acmgd.dll) from AutoCAD 2008 but this doesn't really work.&lt;BR /&gt;
The program is compileable but when i execute it, i get an "File-Not-Found" exception!&lt;BR /&gt;
&lt;BR /&gt;
So i went back to the activex api.&lt;BR /&gt;
&lt;BR /&gt;
Regards &lt;BR /&gt;
Mario</description>
      <pubDate>Wed, 12 Aug 2009 13:56:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537879#M69446</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-12T13:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537880#M69447</link>
      <description>Hi Mario,&lt;BR /&gt;
&lt;BR /&gt;
The VBA newsgroup is NOT the ActiveX/COM newsgroup, it is the VBA &lt;BR /&gt;
newsgroup, and, since they are so similar by logical extension the VB6 &lt;BR /&gt;
newsgroup.&lt;BR /&gt;
&lt;BR /&gt;
This is the .NET newsgroup, not just the managed half of .DOTNET newsgroup.&lt;BR /&gt;
&lt;BR /&gt;
Regardless of numbers of readers and posters, any help ever offered to &lt;BR /&gt;
any form of .NET programming in the other newsgroup is inevitably from &lt;BR /&gt;
Tony himself or from other readers whose posts you will see in both &lt;BR /&gt;
newsgroups.  Please don't pollute that newsgroup with queries for which &lt;BR /&gt;
you will find the necessary expertise here.&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;
TeiMar71 wrote:&lt;BR /&gt;
&amp;gt; Thanx Tony ... i understand!&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I tried to reference to the managed DLLs (acdbmgd.dll and acmgd.dll) from AutoCAD 2008 but this doesn't really work.&lt;BR /&gt;
&amp;gt; The program is compileable but when i execute it, i get an "File-Not-Found" exception!&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; So i went back to the activex api.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Regards &lt;BR /&gt;
&amp;gt; Mario

Edited by: Discussion_Admin on Sep 16, 2009 11:54 AM</description>
      <pubDate>Wed, 12 Aug 2009 21:48:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537880#M69447</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-12T21:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537881#M69448</link>
      <description>Laurie - where should people who are accessing AutoCAD via COM and not using &lt;BR /&gt;
a .NET language go for help? Bunches of programming languages can use COM &lt;BR /&gt;
and there are only a few AutoCAD APIs. Wouldn't simple logic be to group &lt;BR /&gt;
questions by API and not by language? Most competent coders are looking for &lt;BR /&gt;
API help when they come to these groups and go to language specific groups &lt;BR /&gt;
when they need help with their specific language.&lt;BR /&gt;
&lt;BR /&gt;
Of course there will be crossover here but the more we properly group &lt;BR /&gt;
questions the easier it is for users. Just because you live in one world &lt;BR /&gt;
doesn't mean we should all keep the VBA group just for ActiveX via VBA and &lt;BR /&gt;
everything else goes to the .NET group. Just doesn't make any logical sense!&lt;BR /&gt;
&lt;BR /&gt;
Where did COM questions go before the .NET group? The VBA group is going to &lt;BR /&gt;
be a lonely place once VBA is dead... Or maybe someone will use some logic &lt;BR /&gt;
and rename it ActiveX since that is where most of the ActiveX answers are &lt;BR /&gt;
stored!&lt;BR /&gt;
&lt;BR /&gt;
"Laurie" &lt;LAURIE&gt; wrote in message &lt;BR /&gt;
news:6236198@discussion.autodesk.com...&lt;BR /&gt;
Hi Mario,&lt;BR /&gt;
&lt;BR /&gt;
In this case Tony's advice is based on his dyslexia and inability to&lt;BR /&gt;
understand English language names.&lt;BR /&gt;
&lt;BR /&gt;
The VBA newsgroup is NOT the ActiveX/COM newsgroup, it is the VBA&lt;BR /&gt;
newsgroup, and, since they are so similar by logical extension the VB6&lt;BR /&gt;
newsgroup.&lt;BR /&gt;
&lt;BR /&gt;
This is the .NET newsgroup, not just the managed half of .DOTNET newsgroup.&lt;BR /&gt;
&lt;BR /&gt;
Regardless of numbers of readers and posters, any help ever offered to&lt;BR /&gt;
any form of .NET programming in the other newsgroup is inevitably from&lt;BR /&gt;
Tony himself or from other readers whose posts you will see in both&lt;BR /&gt;
newsgroups.  Please don't pollute that newsgroup with queries for which&lt;BR /&gt;
you will find the necessary expertise here.&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;
TeiMar71 wrote:&lt;BR /&gt;
&amp;gt; Thanx Tony ... i understand!&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I tried to reference to the managed DLLs (acdbmgd.dll and acmgd.dll) from &lt;BR /&gt;
&amp;gt; AutoCAD 2008 but this doesn't really work.&lt;BR /&gt;
&amp;gt; The program is compileable but when i execute it, i get an &lt;BR /&gt;
&amp;gt; "File-Not-Found" exception!&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; So i went back to the activex api.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Regards&lt;BR /&gt;
&amp;gt; Mario&lt;/LAURIE&gt;</description>
      <pubDate>Wed, 12 Aug 2009 22:50:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537881#M69448</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-12T22:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537882#M69449</link>
      <description>I can not believe that you believe someone should post in a group based on the technicality of the title as opposed to the help that can be provided.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Edited by: Discussion_Admin  on Sep 16, 2009 12:00 PM</description>
      <pubDate>Wed, 12 Aug 2009 22:57:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537882#M69449</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-12T22:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537883#M69450</link>
      <description>Hi Paul,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Laurie - where should people who are accessing AutoCAD via COM and not &lt;BR /&gt;
using a .NET language go for help?"&lt;BR /&gt;
&lt;BR /&gt;
Would you go to the VBA newsgroup, this one, the general customisation &lt;BR /&gt;
NG, the ObjectARX NG or onto the internet in general?&lt;BR /&gt;
I'd come here on the grounds that I'd expect the general expertise (and &lt;BR /&gt;
training as programmers) of .NET programmers to be higher than the &lt;BR /&gt;
general (and training as programmers) expertise of VBA or lispers. &lt;BR /&gt;
However the question is largely a furphy as very few questions from &lt;BR /&gt;
programmers in other languages ever turn up in theses newsgroups. Even &lt;BR /&gt;
when they do, they are rarely answered satisfactorily and almost never &lt;BR /&gt;
by the VBAers.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Wouldn't simple logic be to group questions by API and not by language?"&lt;BR /&gt;
&lt;BR /&gt;
I can't see any more logic in that than setting up newsgroups by &lt;BR /&gt;
language.  And clearly Autodesk didn’t when setting up their newsgroup &lt;BR /&gt;
structure.  In their wisdom Autodesk set up a VBA NG long before they &lt;BR /&gt;
set up the .NET NG.  In VBA the issue of Managed Code v ActiveX/COM &lt;BR /&gt;
programming doesn't arise and there is no reason to expect a VBA &lt;BR /&gt;
programmer to have knowledge of what the difference is or what the &lt;BR /&gt;
implications of that difference are. So you are arguing that based on a &lt;BR /&gt;
distinction which need only be understood in .NET some .NET questions &lt;BR /&gt;
should be sent to a newsgroup where knowledge of this distinction is &lt;BR /&gt;
irrelevant&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Of course there will be crossover here but the more we properly group &lt;BR /&gt;
questions the easier it is for users"&lt;BR /&gt;
&lt;BR /&gt;
I couldn’t agree more.  It’s the whole point of my posting.  But why do &lt;BR /&gt;
a small number of posters here make up their own minds that a particular &lt;BR /&gt;
aspect of a programming language must be handled in a newsgroup where &lt;BR /&gt;
the chances of the issue being understood are far lower than in the &lt;BR /&gt;
newsgroup named to handle that language/issue?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Just because you live in one world doesn't mean we should all keep the &lt;BR /&gt;
VBA group just for ActiveX via VBA and everything else goes to the .NET &lt;BR /&gt;
group.  Just doesn't make any logical sense!"&lt;BR /&gt;
&lt;BR /&gt;
Where I live and help is irrelevant.  The approach that VBA uses ActiveX &lt;BR /&gt;
therefore every ActiveX query should go to the VBA NG is far less &lt;BR /&gt;
logical than following the names and labels assigned to the NGs by &lt;BR /&gt;
Autodesk.  Do you seriously expect that C programmers are going to be &lt;BR /&gt;
able to get help from VBA programmers?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"The VBA group is going to be a lonely place once VBA is dead... Or &lt;BR /&gt;
maybe someone will use some logic and rename it ActiveX since that is &lt;BR /&gt;
where most of the ActiveX answers are stored!"&lt;BR /&gt;
&lt;BR /&gt;
I don’t doubt that the  64 bit environment will kill VB6/VBA.  However, &lt;BR /&gt;
the logic you are referring to depends on a particular world view and it &lt;BR /&gt;
is at complete odds with the naming and use of these newsgroups as well &lt;BR /&gt;
as the likelihood of finding expertise to resolve a given problem.&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;
Paul Richardson &lt;PRICHARDSON =""&gt;&lt;BR /&gt;
&amp;gt; Laurie - where should people who are accessing AutoCAD via COM and not using &lt;BR /&gt;
&amp;gt; a .NET language go for help? Bunches of programming languages can use COM &lt;BR /&gt;
&amp;gt; and there are only a few AutoCAD APIs. Wouldn't simple logic be to group &lt;BR /&gt;
&amp;gt; questions by API and not by language? Most competent coders are looking for &lt;BR /&gt;
&amp;gt; API help when they come to these groups and go to language specific groups &lt;BR /&gt;
&amp;gt; when they need help with their specific language.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Of course there will be crossover here but the more we properly group &lt;BR /&gt;
&amp;gt; questions the easier it is for users. Just because you live in one world &lt;BR /&gt;
&amp;gt; doesn't mean we should all keep the VBA group just for ActiveX via VBA and &lt;BR /&gt;
&amp;gt; everything else goes to the .NET group. Just doesn't make any logical sense!&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Where did COM questions go before the .NET group? The VBA group is going to &lt;BR /&gt;
&amp;gt; be a lonely place once VBA is dead... Or maybe someone will use some logic &lt;BR /&gt;
&amp;gt; and rename it ActiveX since that is where most of the ActiveX answers are &lt;BR /&gt;
&amp;gt; stored!&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; "Laurie" &lt;LAURIE&gt; wrote in message &lt;BR /&gt;
&amp;gt; news:6236198@discussion.autodesk.com...&lt;BR /&gt;
&amp;gt; Hi Mario,&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; In this case Tony's advice is based on his dyslexia and inability to&lt;BR /&gt;
&amp;gt; understand English language names.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; The VBA newsgroup is NOT the ActiveX/COM newsgroup, it is the VBA&lt;BR /&gt;
&amp;gt; newsgroup, and, since they are so similar by logical extension the VB6&lt;BR /&gt;
&amp;gt; newsgroup.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; This is the .NET newsgroup, not just the managed half of .DOTNET newsgroup.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Regardless of numbers of readers and posters, any help ever offered to&lt;BR /&gt;
&amp;gt; any form of .NET programming in the other newsgroup is inevitably from&lt;BR /&gt;
&amp;gt; Tony himself or from other readers whose posts you will see in both&lt;BR /&gt;
&amp;gt; newsgroups.  Please don't pollute that newsgroup with queries for which&lt;BR /&gt;
&amp;gt; you will find the necessary expertise here.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Regards,&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Laurie Comerford&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; TeiMar71 wrote:&lt;BR /&gt;
&amp;gt;&amp;gt; Thanx Tony ... i understand!&lt;BR /&gt;
&amp;gt;&amp;gt;&lt;BR /&gt;
&amp;gt;&amp;gt; I tried to reference to the managed DLLs (acdbmgd.dll and acmgd.dll) from &lt;BR /&gt;
&amp;gt;&amp;gt; AutoCAD 2008 but this doesn't really work.&lt;BR /&gt;
&amp;gt;&amp;gt; The program is compileable but when i execute it, i get an &lt;BR /&gt;
&amp;gt;&amp;gt; "File-Not-Found" exception!&lt;BR /&gt;
&amp;gt;&amp;gt;&lt;BR /&gt;
&amp;gt;&amp;gt; So i went back to the activex api.&lt;BR /&gt;
&amp;gt;&amp;gt;&lt;BR /&gt;
&amp;gt;&amp;gt; Regards&lt;BR /&gt;
&amp;gt;&amp;gt; Mario&lt;/LAURIE&gt;&lt;/PRICHARDSON&gt;</description>
      <pubDate>Thu, 13 Aug 2009 05:24:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537883#M69450</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-13T05:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537884#M69451</link>
      <description>{quote}&lt;BR /&gt;
Do you seriously expect that C programmers are going to be  able to get help &lt;BR /&gt;
from VBA programmers?&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
Once again why would a C programmer need help with syntax or structure and &lt;BR /&gt;
if they do they would go to a specific group on C using COM. What they need &lt;BR /&gt;
is the answer to how do I do 'X"? Doesn't take a C programmer to answer that &lt;BR /&gt;
question - just someone that uses the API.&lt;BR /&gt;
&lt;BR /&gt;
You do realize that it's the same ActiveX API regardless of the COM aware &lt;BR /&gt;
language being used. You cannot seem to get over that most don't want their &lt;BR /&gt;
hand held with using a language. This doesn't mean it won't happen from time &lt;BR /&gt;
to time - I've had mine held here but 99 percent of the time it's not what I &lt;BR /&gt;
or others need and if we do we are in the worng place.&lt;BR /&gt;
&lt;BR /&gt;
You should give VBAers more credit as I'd bet most realize they have much &lt;BR /&gt;
more knowledge in their heads than just a language.&lt;BR /&gt;
&lt;BR /&gt;
"Laurie" &lt;LAURIE&gt; wrote in message &lt;BR /&gt;
news:6236358@discussion.autodesk.com...&lt;BR /&gt;
Hi Paul,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Laurie - where should people who are accessing AutoCAD via COM and not&lt;BR /&gt;
using a .NET language go for help?"&lt;BR /&gt;
&lt;BR /&gt;
Would you go to the VBA newsgroup, this one, the general customisation&lt;BR /&gt;
NG, the ObjectARX NG or onto the internet in general?&lt;BR /&gt;
I'd come here on the grounds that I'd expect the general expertise (and&lt;BR /&gt;
training as programmers) of .NET programmers to be higher than the&lt;BR /&gt;
general (and training as programmers) expertise of VBA or lispers.&lt;BR /&gt;
However the question is largely a furphy as very few questions from&lt;BR /&gt;
programmers in other languages ever turn up in theses newsgroups. Even&lt;BR /&gt;
when they do, they are rarely answered satisfactorily and almost never&lt;BR /&gt;
by the VBAers.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Wouldn't simple logic be to group questions by API and not by language?"&lt;BR /&gt;
&lt;BR /&gt;
I can't see any more logic in that than setting up newsgroups by&lt;BR /&gt;
language.  And clearly Autodesk didn't when setting up their newsgroup&lt;BR /&gt;
structure.  In their wisdom Autodesk set up a VBA NG long before they&lt;BR /&gt;
set up the .NET NG.  In VBA the issue of Managed Code v ActiveX/COM&lt;BR /&gt;
programming doesn't arise and there is no reason to expect a VBA&lt;BR /&gt;
programmer to have knowledge of what the difference is or what the&lt;BR /&gt;
implications of that difference are. So you are arguing that based on a&lt;BR /&gt;
distinction which need only be understood in .NET some .NET questions&lt;BR /&gt;
should be sent to a newsgroup where knowledge of this distinction is&lt;BR /&gt;
irrelevant&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Of course there will be crossover here but the more we properly group&lt;BR /&gt;
questions the easier it is for users"&lt;BR /&gt;
&lt;BR /&gt;
I couldn't agree more.  It's the whole point of my posting.  But why do&lt;BR /&gt;
a small number of posters here make up their own minds that a particular&lt;BR /&gt;
aspect of a programming language must be handled in a newsgroup where&lt;BR /&gt;
the chances of the issue being understood are far lower than in the&lt;BR /&gt;
newsgroup named to handle that language/issue?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Just because you live in one world doesn't mean we should all keep the&lt;BR /&gt;
VBA group just for ActiveX via VBA and everything else goes to the .NET&lt;BR /&gt;
group.  Just doesn't make any logical sense!"&lt;BR /&gt;
&lt;BR /&gt;
Where I live and help is irrelevant.  The approach that VBA uses ActiveX&lt;BR /&gt;
therefore every ActiveX query should go to the VBA NG is far less&lt;BR /&gt;
logical than following the names and labels assigned to the NGs by&lt;BR /&gt;
Autodesk.  Do you seriously expect that C programmers are going to be&lt;BR /&gt;
able to get help from VBA programmers?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"The VBA group is going to be a lonely place once VBA is dead... Or&lt;BR /&gt;
maybe someone will use some logic and rename it ActiveX since that is&lt;BR /&gt;
where most of the ActiveX answers are stored!"&lt;BR /&gt;
&lt;BR /&gt;
I don't doubt that the  64 bit environment will kill VB6/VBA.  However,&lt;BR /&gt;
the logic you are referring to depends on a particular world view and it&lt;BR /&gt;
is at complete odds with the naming and use of these newsgroups as well&lt;BR /&gt;
as the likelihood of finding expertise to resolve a given problem.&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;
Paul Richardson &lt;PRICHARDSON =""&gt;&lt;BR /&gt;
&amp;gt; Laurie - where should people who are accessing AutoCAD via COM and not &lt;BR /&gt;
&amp;gt; using&lt;BR /&gt;
&amp;gt; a .NET language go for help? Bunches of programming languages can use COM&lt;BR /&gt;
&amp;gt; and there are only a few AutoCAD APIs. Wouldn't simple logic be to group&lt;BR /&gt;
&amp;gt; questions by API and not by language? Most competent coders are looking &lt;BR /&gt;
&amp;gt; for&lt;BR /&gt;
&amp;gt; API help when they come to these groups and go to language specific groups&lt;BR /&gt;
&amp;gt; when they need help with their specific language.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Of course there will be crossover here but the more we properly group&lt;BR /&gt;
&amp;gt; questions the easier it is for users. Just because you live in one world&lt;BR /&gt;
&amp;gt; doesn't mean we should all keep the VBA group just for ActiveX via VBA and&lt;BR /&gt;
&amp;gt; everything else goes to the .NET group. Just doesn't make any logical &lt;BR /&gt;
&amp;gt; sense!&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Where did COM questions go before the .NET group? The VBA group is going &lt;BR /&gt;
&amp;gt; to&lt;BR /&gt;
&amp;gt; be a lonely place once VBA is dead... Or maybe someone will use some logic&lt;BR /&gt;
&amp;gt; and rename it ActiveX since that is where most of the ActiveX answers are&lt;BR /&gt;
&amp;gt; stored!&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Laurie" &lt;LAURIE&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:6236198@discussion.autodesk.com...&lt;BR /&gt;
&amp;gt; Hi Mario,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; In this case Tony's advice is based on his dyslexia and inability to&lt;BR /&gt;
&amp;gt; understand English language names.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; The VBA newsgroup is NOT the ActiveX/COM newsgroup, it is the VBA&lt;BR /&gt;
&amp;gt; newsgroup, and, since they are so similar by logical extension the VB6&lt;BR /&gt;
&amp;gt; newsgroup.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; This is the .NET newsgroup, not just the managed half of .DOTNET &lt;BR /&gt;
&amp;gt; newsgroup.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Regardless of numbers of readers and posters, any help ever offered to&lt;BR /&gt;
&amp;gt; any form of .NET programming in the other newsgroup is inevitably from&lt;BR /&gt;
&amp;gt; Tony himself or from other readers whose posts you will see in both&lt;BR /&gt;
&amp;gt; newsgroups.  Please don't pollute that newsgroup with queries for which&lt;BR /&gt;
&amp;gt; you will find the necessary expertise here.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Regards,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Laurie Comerford&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; TeiMar71 wrote:&lt;BR /&gt;
&amp;gt;&amp;gt; Thanx Tony ... i understand!&lt;BR /&gt;
&amp;gt;&amp;gt;&lt;BR /&gt;
&amp;gt;&amp;gt; I tried to reference to the managed DLLs (acdbmgd.dll and acmgd.dll) from&lt;BR /&gt;
&amp;gt;&amp;gt; AutoCAD 2008 but this doesn't really work.&lt;BR /&gt;
&amp;gt;&amp;gt; The program is compileable but when i execute it, i get an&lt;BR /&gt;
&amp;gt;&amp;gt; "File-Not-Found" exception!&lt;BR /&gt;
&amp;gt;&amp;gt;&lt;BR /&gt;
&amp;gt;&amp;gt; So i went back to the activex api.&lt;BR /&gt;
&amp;gt;&amp;gt;&lt;BR /&gt;
&amp;gt;&amp;gt; Regards&lt;BR /&gt;
&amp;gt;&amp;gt; Mario&lt;/LAURIE&gt;&lt;/PRICHARDSON&gt;&lt;/LAURIE&gt;</description>
      <pubDate>Thu, 13 Aug 2009 08:16:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537884#M69451</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-13T08:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537885#M69452</link>
      <description>Can I post Visual Basic 2008 Code that uses the ActiveX API in the Visual Basic Customisation Group?&lt;BR /&gt;
&lt;BR /&gt;
Can I post Visual Basic 2008 Code that uses the .NET API in the Visual Basic Customisation Group?</description>
      <pubDate>Thu, 13 Aug 2009 12:25:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537885#M69452</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-13T12:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537886#M69453</link>
      <description>Mario, Here's quick  a sample not using the COM API&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
using System;&lt;BR /&gt;
using System.Collections.Generic;&lt;BR /&gt;
using System.Text;&lt;BR /&gt;
using Autodesk.AutoCAD.DatabaseServices;&lt;BR /&gt;
using Autodesk.AutoCAD.EditorInput;&lt;BR /&gt;
using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;
using AcAp = Autodesk.AutoCAD.ApplicationServices;&lt;BR /&gt;
using AcDb = Autodesk.AutoCAD.DatabaseServices;&lt;BR /&gt;
&lt;BR /&gt;
[assembly: CommandClass(typeof(CsGetBlkDefs.Commands))]&lt;BR /&gt;
&lt;BR /&gt;
namespace CsGetBlkDefs&lt;BR /&gt;
{&lt;BR /&gt;
 public class MyAttRef&lt;BR /&gt;
 {&lt;BR /&gt;
  public ObjectId id { get; set; }&lt;BR /&gt;
  public String text { get; set; }&lt;BR /&gt;
 }&lt;BR /&gt;
&lt;BR /&gt;
 public class MyBlkRef&lt;BR /&gt;
 {&lt;BR /&gt;
  public String name { get; set; }&lt;BR /&gt;
  public ObjectId id { get; set; }&lt;BR /&gt;
  public List&lt;MYATTREF&gt; myAttRef { get; set; }&lt;BR /&gt;
 }&lt;BR /&gt;
&lt;BR /&gt;
 public class MyBlkRefs : List&lt;MYBLKREF&gt; { }&lt;BR /&gt;
&lt;BR /&gt;
 public class Commands&lt;BR /&gt;
 {&lt;BR /&gt;
  public Commands() { }&lt;BR /&gt;
&lt;BR /&gt;
  [CommandMethod("doit", CommandFlags.Session)]&lt;BR /&gt;
  static public void doit()&lt;BR /&gt;
  {&lt;BR /&gt;
   Editor ed = &lt;BR /&gt;
    AcAp.Application.DocumentManager.MdiActiveDocument.Editor;&lt;BR /&gt;
&lt;BR /&gt;
   string dwgPath = @"c:\Drawings\tmp.dwg";&lt;BR /&gt;
   Database db = new Database(false,true);&lt;BR /&gt;
&lt;BR /&gt;
   db.ReadDwgFile(dwgPath, &lt;BR /&gt;
    FileOpenMode.OpenForReadAndAllShare, false, string.Empty);&lt;BR /&gt;
&lt;BR /&gt;
   try&lt;BR /&gt;
   {&lt;BR /&gt;
    AcDb.TransactionManager tm = db.TransactionManager;&lt;BR /&gt;
    MyBlkRefs myBlkRefs = new MyBlkRefs();&lt;BR /&gt;
&lt;BR /&gt;
    using (Transaction tr = tm.StartTransaction())&lt;BR /&gt;
    {&lt;BR /&gt;
     BlockTable bt = tr.GetObject&lt;BR /&gt;
       (db.BlockTableId, OpenMode.ForRead, false)&lt;BR /&gt;
           as BlockTable;&lt;BR /&gt;
&lt;BR /&gt;
     foreach (ObjectId btrId in bt)&lt;BR /&gt;
     {&lt;BR /&gt;
      BlockTableRecord btr = tr.GetObject&lt;BR /&gt;
        (btrId, OpenMode.ForRead, false)&lt;BR /&gt;
           as BlockTableRecord;&lt;BR /&gt;
&lt;BR /&gt;
      if (btr.HasAttributeDefinitions == true &amp;amp;&amp;amp;&lt;BR /&gt;
          btr.IsAnonymous == false &amp;amp;&amp;amp;&lt;BR /&gt;
          btr.IsDynamicBlock == false)&lt;BR /&gt;
      {&lt;BR /&gt;
       ObjectIdCollection blkRefIds =&lt;BR /&gt;
         btr.GetBlockReferenceIds(false, false);&lt;BR /&gt;
&lt;BR /&gt;
       foreach (ObjectId blkRefId in blkRefIds)&lt;BR /&gt;
       {&lt;BR /&gt;
        BlockReference blkRef = tr.GetObject&lt;BR /&gt;
          (blkRefId, OpenMode.ForRead, false)&lt;BR /&gt;
            as BlockReference;&lt;BR /&gt;
&lt;BR /&gt;
        MyBlkRef myBlkRef = new MyBlkRef&lt;BR /&gt;
        {&lt;BR /&gt;
         name = blkRef.Name,&lt;BR /&gt;
         id = blkRefId,&lt;BR /&gt;
         myAttRef = new List&lt;MYATTREF&gt;()&lt;BR /&gt;
        };&lt;BR /&gt;
&lt;BR /&gt;
        foreach (ObjectId attRefId in&lt;BR /&gt;
                 blkRef.AttributeCollection)&lt;BR /&gt;
        {&lt;BR /&gt;
         AttributeReference attRef = tr.GetObject&lt;BR /&gt;
           (attRefId, OpenMode.ForRead)&lt;BR /&gt;
              as AttributeReference;&lt;BR /&gt;
&lt;BR /&gt;
         myBlkRef.myAttRef.Add&lt;BR /&gt;
           (new MyAttRef&lt;BR /&gt;
             {&lt;BR /&gt;
              id = attRefId,&lt;BR /&gt;
              text = attRef.TextString&lt;BR /&gt;
             });&lt;BR /&gt;
        }&lt;BR /&gt;
        myBlkRefs.Add(myBlkRef);&lt;BR /&gt;
       }&lt;BR /&gt;
      }&lt;BR /&gt;
     }&lt;BR /&gt;
     tr.Commit();&lt;BR /&gt;
    }&lt;BR /&gt;
    foreach (var Item in myBlkRefs)&lt;BR /&gt;
    {&lt;BR /&gt;
     StringBuilder sb = new StringBuilder();&lt;BR /&gt;
     sb.Append(string.Format("{0} --- ", Item.name));&lt;BR /&gt;
     Item.myAttRef.ForEach(subItem =&amp;gt;&lt;BR /&gt;
       sb.Append(string.Format("{0} ", subItem.text)));&lt;BR /&gt;
     ed.WriteMessage("\n{0}", sb);&lt;BR /&gt;
    }&lt;BR /&gt;
   }&lt;BR /&gt;
   catch (System.Exception ex)&lt;BR /&gt;
   {&lt;BR /&gt;
    ed.WriteMessage(ex.Message);&lt;BR /&gt;
   }&lt;BR /&gt;
   finally&lt;BR /&gt;
   {&lt;BR /&gt;
    db.CloseInput(true);&lt;BR /&gt;
    db.Dispose();&lt;BR /&gt;
   }&lt;BR /&gt;
  }&lt;BR /&gt;
 }&lt;BR /&gt;
}&lt;BR /&gt;
{code}&lt;/MYATTREF&gt;&lt;/MYBLKREF&gt;&lt;/MYATTREF&gt;</description>
      <pubDate>Thu, 13 Aug 2009 13:04:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537886#M69453</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-13T13:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537887#M69454</link>
      <description>I guess you need to supply your own angle brackets for the List &amp;lt;...&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
see if this is better&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
using System;&lt;BR /&gt;
using System.Collections.Generic;&lt;BR /&gt;
using System.Text;&lt;BR /&gt;
using Autodesk.AutoCAD.DatabaseServices;&lt;BR /&gt;
using Autodesk.AutoCAD.EditorInput;&lt;BR /&gt;
using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;
using AcAp = Autodesk.AutoCAD.ApplicationServices;&lt;BR /&gt;
using AcDb = Autodesk.AutoCAD.DatabaseServices;&lt;BR /&gt;
&lt;BR /&gt;
[assembly: CommandClass(typeof(CsGetBlkDefs.Commands))]&lt;BR /&gt;
&lt;BR /&gt;
namespace CsGetBlkDefs&lt;BR /&gt;
{&lt;BR /&gt;
 public class MyAttRef&lt;BR /&gt;
 {&lt;BR /&gt;
  public ObjectId id { get; set; }&lt;BR /&gt;
  public String text { get; set; }&lt;BR /&gt;
 }&lt;BR /&gt;
&lt;BR /&gt;
 public class MyBlkRef&lt;BR /&gt;
 {&lt;BR /&gt;
  public String name { get; set; }&lt;BR /&gt;
  public ObjectId id { get; set; }&lt;BR /&gt;
  public List&amp;lt;MyAttRef&amp;gt; myAttRef { get; set; }&lt;BR /&gt;
 }&lt;BR /&gt;
&lt;BR /&gt;
 public class MyBlkRefs : List&amp;lt;MyBlkRef&amp;gt; { }&lt;BR /&gt;
&lt;BR /&gt;
 public class Commands&lt;BR /&gt;
 {&lt;BR /&gt;
  public Commands() { }&lt;BR /&gt;
&lt;BR /&gt;
  [CommandMethod("doit", CommandFlags.Session)]&lt;BR /&gt;
  static public void doit()&lt;BR /&gt;
  {&lt;BR /&gt;
   Editor ed = &lt;BR /&gt;
    AcAp.Application.DocumentManager.MdiActiveDocument.Editor;&lt;BR /&gt;
&lt;BR /&gt;
   string dwgPath = @"c:\Drawings\tmp.dwg";&lt;BR /&gt;
   Database db = new Database(false,true);&lt;BR /&gt;
&lt;BR /&gt;
   db.ReadDwgFile(dwgPath, &lt;BR /&gt;
    FileOpenMode.OpenForReadAndAllShare, false, string.Empty);&lt;BR /&gt;
&lt;BR /&gt;
   try&lt;BR /&gt;
   {&lt;BR /&gt;
    AcDb.TransactionManager tm = db.TransactionManager;&lt;BR /&gt;
    MyBlkRefs myBlkRefs = new MyBlkRefs();&lt;BR /&gt;
&lt;BR /&gt;
    using (Transaction tr = tm.StartTransaction())&lt;BR /&gt;
    {&lt;BR /&gt;
     BlockTable bt = tr.GetObject&lt;BR /&gt;
       (db.BlockTableId, OpenMode.ForRead, false)&lt;BR /&gt;
           as BlockTable;&lt;BR /&gt;
&lt;BR /&gt;
     foreach (ObjectId btrId in bt)&lt;BR /&gt;
     {&lt;BR /&gt;
      BlockTableRecord btr = tr.GetObject&lt;BR /&gt;
        (btrId, OpenMode.ForRead, false)&lt;BR /&gt;
           as BlockTableRecord;&lt;BR /&gt;
&lt;BR /&gt;
      if (btr.HasAttributeDefinitions == true &amp;amp;&amp;amp;&lt;BR /&gt;
          btr.IsAnonymous == false &amp;amp;&amp;amp;&lt;BR /&gt;
          btr.IsDynamicBlock == false)&lt;BR /&gt;
      {&lt;BR /&gt;
       ObjectIdCollection blkRefIds =&lt;BR /&gt;
         btr.GetBlockReferenceIds(false, false);&lt;BR /&gt;
&lt;BR /&gt;
       foreach (ObjectId blkRefId in blkRefIds)&lt;BR /&gt;
       {&lt;BR /&gt;
        BlockReference blkRef = tr.GetObject&lt;BR /&gt;
          (blkRefId, OpenMode.ForRead, false)&lt;BR /&gt;
            as BlockReference;&lt;BR /&gt;
&lt;BR /&gt;
        MyBlkRef myBlkRef = new MyBlkRef&lt;BR /&gt;
        {&lt;BR /&gt;
         name = blkRef.Name,&lt;BR /&gt;
         id = blkRefId,&lt;BR /&gt;
         myAttRef = new List&amp;lt;MyAttRef&amp;gt;()&lt;BR /&gt;
        };&lt;BR /&gt;
&lt;BR /&gt;
        foreach (ObjectId attRefId in&lt;BR /&gt;
                 blkRef.AttributeCollection)&lt;BR /&gt;
        {&lt;BR /&gt;
         AttributeReference attRef = tr.GetObject&lt;BR /&gt;
           (attRefId, OpenMode.ForRead)&lt;BR /&gt;
              as AttributeReference;&lt;BR /&gt;
&lt;BR /&gt;
         myBlkRef.myAttRef.Add&lt;BR /&gt;
           (new MyAttRef&lt;BR /&gt;
             {&lt;BR /&gt;
              id = attRefId,&lt;BR /&gt;
              text = attRef.TextString&lt;BR /&gt;
             });&lt;BR /&gt;
        }&lt;BR /&gt;
        myBlkRefs.Add(myBlkRef);&lt;BR /&gt;
       }&lt;BR /&gt;
      }&lt;BR /&gt;
     }&lt;BR /&gt;
     tr.Commit();&lt;BR /&gt;
    }&lt;BR /&gt;
    foreach (var Item in myBlkRefs)&lt;BR /&gt;
    {&lt;BR /&gt;
     StringBuilder sb = new StringBuilder();&lt;BR /&gt;
     sb.Append(string.Format("{0} --- ", Item.name));&lt;BR /&gt;
     Item.myAttRef.ForEach(subItem =&amp;gt;&lt;BR /&gt;
       sb.Append(string.Format("{0} ", subItem.text)));&lt;BR /&gt;
     ed.WriteMessage("\n{0}", sb);&lt;BR /&gt;
    }&lt;BR /&gt;
   }&lt;BR /&gt;
   catch (System.Exception ex)&lt;BR /&gt;
   {&lt;BR /&gt;
    ed.WriteMessage(ex.Message);&lt;BR /&gt;
   }&lt;BR /&gt;
   finally&lt;BR /&gt;
   {&lt;BR /&gt;
    db.CloseInput(true);&lt;BR /&gt;
    db.Dispose();&lt;BR /&gt;
   }&lt;BR /&gt;
  }&lt;BR /&gt;
 }&lt;BR /&gt;
}&lt;BR /&gt;
{code}</description>
      <pubDate>Thu, 13 Aug 2009 13:48:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537887#M69454</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-13T13:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537888#M69455</link>
      <description>cool .. thanx&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
Mario</description>
      <pubDate>Thu, 13 Aug 2009 13:54:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537888#M69455</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-13T13:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537889#M69456</link>
      <description>Laurie:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Do you seriously expect that C programmers are going to&lt;BR /&gt;
&amp;gt; be able to get help from VBA programmers?&lt;BR /&gt;
&lt;BR /&gt;
  Do you seriously expect that C programmers will be able to help people &lt;BR /&gt;
with the COM API?  I'll bet the only C# or C++ programmers that help with &lt;BR /&gt;
COM API problems are those who gained experience with it in VBA.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; I'd come here on the grounds that I'd expect the general expertise&lt;BR /&gt;
&amp;gt; (and training as programmers) of .NET programmers to be higher&lt;BR /&gt;
&amp;gt; than the general (and training as programmers) expertise of VBA&lt;BR /&gt;
&amp;gt; or lispers.&lt;BR /&gt;
&lt;BR /&gt;
  I think your premise is irrelevant, but in any case, do you call your &lt;BR /&gt;
doctor when your car breaks down?&lt;BR /&gt;
-- &lt;BR /&gt;
Owen Wengerd&lt;BR /&gt;
President, ManuSoft &lt;&gt;&lt;BR /&gt;
VP Americas, CADLock, Inc. &lt;&gt;&lt;/&gt;&lt;/&gt;</description>
      <pubDate>Thu, 13 Aug 2009 19:28:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537889#M69456</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-13T19:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537890#M69457</link>
      <description>still Iam getting this code abstract error , can u pls give corrected code</description>
      <pubDate>Fri, 11 Sep 2009 08:08:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537890#M69457</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-11T08:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Read all Block in C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537891#M69458</link>
      <description>If you'd post ALL the code, or better yet a zipped solution I'll have a look &lt;BR /&gt;
at it tomorrow&lt;BR /&gt;
... there seems to be several errors visible, perhaps there are more &lt;BR /&gt;
elsewhere.&lt;BR /&gt;
&lt;BR /&gt;
/// kdub&lt;BR /&gt;
&lt;BR /&gt;
&lt;NLVVCH&gt; wrote in message news:6252835@discussion.autodesk.com...&lt;BR /&gt;
still Iam getting this code abstract error , can u pls give corrected code&lt;/NLVVCH&gt;</description>
      <pubDate>Fri, 11 Sep 2009 08:25:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/read-all-block-in-c/m-p/2537891#M69458</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-11T08:25:03Z</dc:date>
    </item>
  </channel>
</rss>

