<?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: How to get anonymous blocks' name? in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857474#M22197</link>
    <description>Hi all,&lt;BR /&gt;
I think I have to reformulate my question...&lt;BR /&gt;
&lt;BR /&gt;
I exploded the block using the AcDbBlockReference::ExplodeToOwnerSpace() method, and then I used my code to get the name of the resulting blocks. The result was the same than using AcDbBlockReference::Explode(). It is OK, because as expected, the behaviour of both functions is coherent. But it is very very frustrating because when I look at the AutoCAD properties panel, I still see a name which does not start with *U (i.e. MYBLOCK3)&lt;BR /&gt;
&lt;BR /&gt;
So, the question is now the following:&lt;BR /&gt;
&lt;BR /&gt;
What does AutoCAD do to show a name at the properties panel which is not an anonymous block name? &lt;BR /&gt;
&lt;BR /&gt;
Thanks a lot for your help and patience &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Regards</description>
    <pubDate>Wed, 17 Jan 2007 18:32:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-01-17T18:32:53Z</dc:date>
    <item>
      <title>How to get anonymous blocks' name?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857464#M22187</link>
      <description>Hi all,&lt;BR /&gt;
I am writing some code to solve this:&lt;BR /&gt;
&lt;BR /&gt;
I have a drawing containing simple blocks and "compound" blocks (blocks composed by smaller blocks). I prompt the user to select a block. If the block is a simple one, I simply show its name. Otherwise, I have to get the names of its sub-blocks and show them to the user.&lt;BR /&gt;
&lt;BR /&gt;
When I thought I got it, I saw that when exploding some compound blocks (using AcDbEntity::explode()), some of the entities returned are anonymous blocks (*U80, *U67, ...). I tried to get its name reading BlockTableRecord, but I get the anonymous autogenerated name. I checked if  the blocks are dynamic (so as to take its name from DynamicBlockTableRecord), but they aren't.&lt;BR /&gt;
&lt;BR /&gt;
Can anybody help me?&lt;BR /&gt;
&lt;BR /&gt;
P.S.: I am using AutoCAD 2006 and ObjectARX 2006&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 09 Jan 2007 11:39:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857464#M22187</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-09T11:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get anonymous blocks' name?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857465#M22188</link>
      <description>The name of an anonymous block?&lt;BR /&gt;
&lt;BR /&gt;
What you refer to as the 'autogenerated name'&lt;BR /&gt;
(the string starting with "*U", followed by an &lt;BR /&gt;
ordinal number) is the only 'name' there is.&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 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;RUBENDM&gt; wrote in message news:5445051@discussion.autodesk.com...&lt;BR /&gt;
Hi all,&lt;BR /&gt;
I am writing some code to solve this:&lt;BR /&gt;
&lt;BR /&gt;
I have a drawing containing simple blocks and "compound" blocks (blocks composed by smaller blocks). I prompt the user to select a block. If the block is a simple one, I simply show its name. Otherwise, I have to get the names of its sub-blocks and show them to the user.&lt;BR /&gt;
&lt;BR /&gt;
When I thought I got it, I saw that when exploding some compound blocks (using AcDbEntity::explode()), some of the entities returned are anonymous blocks (*U80, *U67, ...). I tried to get its name reading BlockTableRecord, but I get the anonymous autogenerated name. I checked if  the blocks are dynamic (so as to take its name from DynamicBlockTableRecord), but they aren't.&lt;BR /&gt;
&lt;BR /&gt;
Can anybody help me?&lt;BR /&gt;
&lt;BR /&gt;
P.S.: I am using AutoCAD 2006 and ObjectARX 2006&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/RUBENDM&gt;</description>
      <pubDate>Tue, 09 Jan 2007 20:33:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857465#M22188</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-09T20:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get anonymous blocks' name?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857466#M22189</link>
      <description>Hi Tony,&lt;BR /&gt;
I am a little bit confused at this time... I am an AutoCAD newbie, and I still have a weak knowledge on this&lt;BR /&gt;
&lt;BR /&gt;
When I take one of the 'compound' blocks in my drawing and I explode it using the XPLODE command, the resulting blocks are named blocks (I can see its name at the properties page). But if I try to access to the block components using AcDbEntity::explode, I get anonymous block references. What I need to do is to get the name I see using the XPLODE command. &lt;BR /&gt;
&lt;BR /&gt;
At this moment I was trying to do this avoiding to explode the block at the drawing, because at last I would need to build again the original block... Anyway, if there is not another way to get what I need, I will implement this workaround...&lt;BR /&gt;
&lt;BR /&gt;
I think the fact I still don't understand very well the 'anonymous block' concept does not help. I have been searching more information on this, but I haven't found much things...&lt;BR /&gt;
&lt;BR /&gt;
Any kind of help with this will be welcome&lt;BR /&gt;
&lt;BR /&gt;
Thank you very much  &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Wed, 10 Jan 2007 08:10:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857466#M22189</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-10T08:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get anonymous blocks' name?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857467#M22190</link>
      <description>A block reference is basically a reference to a block definition plus a matrix to control it's movement/rotation etc. It has no name of its own.&lt;BR /&gt;
&lt;BR /&gt;
A block definition is a named collection of entities. These entities may be block references which may yield many levels of nested blocks. &lt;BR /&gt;
&lt;BR /&gt;
AFAIK, the only difference between a named and unnamed block is that the latter's name start with an '*'. There are some special blocks, model and paper spaces that also has names beginning with '*'.&lt;BR /&gt;
&lt;BR /&gt;
Henrik Vallgren</description>
      <pubDate>Tue, 16 Jan 2007 14:10:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857467#M22190</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-16T14:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get anonymous blocks' name?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857468#M22191</link>
      <description>Hi Henry,&lt;BR /&gt;
Thanks for your help. Now things seem a little more clearer. &lt;BR /&gt;
&lt;BR /&gt;
I still don't know how AutoCAD does it to show a 'comprehensive' name (i.e. 'MYBLOCK1') after executing XPLODE, while I get an '*U..." name when I call AcDbEntity::explode&lt;BR /&gt;
&lt;BR /&gt;
Anyway, thank you very much</description>
      <pubDate>Wed, 17 Jan 2007 07:51:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857468#M22191</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-17T07:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get anonymous blocks' name?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857469#M22192</link>
      <description>I'm having trouble believing that it would generate different names ... could there be multiple blocks? Then there are dimensions: those are sort of blocks.&lt;BR /&gt;
&lt;BR /&gt;
There's an excellent sample, ARXDBG(samples/database/arxdbg), that will let you examine the dwg structure. Take a look at it. After building and loading the arx, right click and the added commands will show.</description>
      <pubDate>Wed, 17 Jan 2007 08:03:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857469#M22192</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-17T08:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to get anonymous blocks' name?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857470#M22193</link>
      <description>Hi again,&lt;BR /&gt;
Thank you so much for your help. But I still have another problem: I am working with VS 2005 and AutoCAD 2006, and VS 2005 is unable to compile the ARXDBG sample.&lt;BR /&gt;
&lt;BR /&gt;
I also have ObjectARX 2007, and I compiled the 2007 ARXDBG sample, but it does not work with AutoCAD 2006. I think I will have to wait until I got a copy of VS 2003, unless you could kindly pack the build results and attach or email them (I used winrar to pack the ObjectARX2007 version, and the resulting file size is 8 Mb)&lt;BR /&gt;
&lt;BR /&gt;
My email address is ruben[dot]dopico[at]gmail[dot]com&lt;BR /&gt;
&lt;BR /&gt;
Anyway, don't worry If you could not do so. I think I can get a VS 2003 copy.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again&lt;BR /&gt;
&lt;BR /&gt;
Rubén Dopico</description>
      <pubDate>Wed, 17 Jan 2007 14:51:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857470#M22193</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-17T14:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get anonymous blocks' name?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857471#M22194</link>
      <description>Hi (once again... :-D)&lt;BR /&gt;
While I don't have installed the VS2003, I am trying to get more information from the blocks by other means.&lt;BR /&gt;
&lt;BR /&gt;
This is the code I am using to get the entities contained by a block:&lt;BR /&gt;
&lt;BR /&gt;
'-------------------------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
Dim subBlocks As New DBObjectCollection()&lt;BR /&gt;
&lt;BR /&gt;
' br is a BlockReference object	&lt;BR /&gt;
br.Explode(subBlocks)&lt;BR /&gt;
&lt;BR /&gt;
For Each subBlock As DBObject In subBlocks&lt;BR /&gt;
&lt;BR /&gt;
        Dim subBlockName As String = ""&lt;BR /&gt;
	If (TypeOf subBlock Is BlockReference) Then&lt;BR /&gt;
		' Gets name from BlockTableRecord&lt;BR /&gt;
		' BlockUtils is a custom class&lt;BR /&gt;
		subBlockName  =    BlockUtils.GetBlockName(CType(subBloque, BlockReference))&lt;BR /&gt;
&lt;BR /&gt;
	Else&lt;BR /&gt;
		subBlockName = subBlock.GetType().Name&lt;BR /&gt;
	End If			&lt;BR /&gt;
&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(subBlockName &amp;amp; vbCrLf)&lt;BR /&gt;
			&lt;BR /&gt;
Next subBlock&lt;BR /&gt;
&lt;BR /&gt;
'-------------------------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
When I select one of the blocks which seem to contain anonymous objects, this is what I get:&lt;BR /&gt;
&lt;BR /&gt;
*U78&lt;BR /&gt;
*U80&lt;BR /&gt;
MYBLOCK1&lt;BR /&gt;
MYBLOCK2&lt;BR /&gt;
Line&lt;BR /&gt;
Line&lt;BR /&gt;
Line&lt;BR /&gt;
Line&lt;BR /&gt;
Line&lt;BR /&gt;
Line&lt;BR /&gt;
Line&lt;BR /&gt;
Line&lt;BR /&gt;
Line&lt;BR /&gt;
Line&lt;BR /&gt;
Line&lt;BR /&gt;
DBText&lt;BR /&gt;
&lt;BR /&gt;
If I use de XPLODE command, I get also four blocks. Looking at the properties panel, I can see that blocks I suppossed anonymous, have a name which does not start with *U...&lt;BR /&gt;
&lt;BR /&gt;
I don't know if this is enough to check that my *U... are not dimensions, or any other kind of blocks...&lt;BR /&gt;
&lt;BR /&gt;
I will keep investigating... If I discover something more, I will come back&lt;BR /&gt;
&lt;BR /&gt;
Thanks again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 17 Jan 2007 16:29:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857471#M22194</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-17T16:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get anonymous blocks' name?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857472#M22195</link>
      <description>VS 2003 won't help&lt;BR /&gt;
You need 2002 for Acad2006&lt;BR /&gt;
&lt;BR /&gt;
/matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;RUBENDM&gt; wrote in message news:5454230@discussion.autodesk.com...&lt;BR /&gt;
Hi again,&lt;BR /&gt;
Thank you so much for your help. But I still have another problem: I am &lt;BR /&gt;
working with VS 2005 and AutoCAD 2006, and VS 2005 is unable to compile the &lt;BR /&gt;
ARXDBG sample.&lt;BR /&gt;
&lt;BR /&gt;
I also have ObjectARX 2007, and I compiled the 2007 ARXDBG sample, but it &lt;BR /&gt;
does not work with AutoCAD 2006. I think I will have to wait until I got a &lt;BR /&gt;
copy of VS 2003, unless you could kindly pack the build results and attach &lt;BR /&gt;
or email them (I used winrar to pack the ObjectARX2007 version, and the &lt;BR /&gt;
resulting file size is 8 Mb)&lt;BR /&gt;
&lt;BR /&gt;
My email address is ruben[dot]dopico[at]gmail[dot]com&lt;BR /&gt;
&lt;BR /&gt;
Anyway, don't worry If you could not do so. I think I can get a VS 2003 &lt;BR /&gt;
copy.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again&lt;BR /&gt;
&lt;BR /&gt;
Rubén Dopico&lt;/RUBENDM&gt;</description>
      <pubDate>Wed, 17 Jan 2007 16:30:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857472#M22195</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-17T16:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get anonymous blocks' name?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857473#M22196</link>
      <description>Hi Matt,&lt;BR /&gt;
Thank you very much for your advice &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Regards</description>
      <pubDate>Wed, 17 Jan 2007 16:32:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857473#M22196</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-17T16:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to get anonymous blocks' name?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857474#M22197</link>
      <description>Hi all,&lt;BR /&gt;
I think I have to reformulate my question...&lt;BR /&gt;
&lt;BR /&gt;
I exploded the block using the AcDbBlockReference::ExplodeToOwnerSpace() method, and then I used my code to get the name of the resulting blocks. The result was the same than using AcDbBlockReference::Explode(). It is OK, because as expected, the behaviour of both functions is coherent. But it is very very frustrating because when I look at the AutoCAD properties panel, I still see a name which does not start with *U (i.e. MYBLOCK3)&lt;BR /&gt;
&lt;BR /&gt;
So, the question is now the following:&lt;BR /&gt;
&lt;BR /&gt;
What does AutoCAD do to show a name at the properties panel which is not an anonymous block name? &lt;BR /&gt;
&lt;BR /&gt;
Thanks a lot for your help and patience &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Regards</description>
      <pubDate>Wed, 17 Jan 2007 18:32:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857474#M22197</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-17T18:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to get anonymous blocks' name?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857475#M22198</link>
      <description>Here I am once again, assuming the risk of turning this thread in a monologue (just a joke, thanks to all for your help)...&lt;BR /&gt;
&lt;BR /&gt;
Well, I read at a forum thread (http://discussion.autodesk.com/adskcsp/thread.jspa?threadID=475274) that "REFEDIT"ing a dynamic block, it will lose its dynamicness and become an unnamed block.&lt;BR /&gt;
&lt;BR /&gt;
Well, just for experimenting, I did it with my compound block: I called REFEDIT, selected the subblocks my app showed as anonymous (*U...), and without modifying them I saved the changes. Then I executed again my app, and surprisingly, the app showed the name AutoCAD was showing for them at the properties panel (MYBLOCK3 and MYBLOCK4).&lt;BR /&gt;
&lt;BR /&gt;
Does anybody know what is happening with this blocks? Why (after executing REFEDIT) can I see its name looking at BlockTableRecord.Name property?&lt;BR /&gt;
&lt;BR /&gt;
I have been experimenting a little more with those blocks:&lt;BR /&gt;
- Although BlockReference.IsAnonymous() returns TRUE, they haven't a valid AnonymousBlockTableReference.&lt;BR /&gt;
- I tried to convert them to static blocks using BlockReference.ConvertToStaticBlock(), but the result was the ACad:eNoDatabase error&lt;BR /&gt;
- Also, this blocks are no external references (BlockReference.IsFromExternalReference returns FALSE)&lt;BR /&gt;
&lt;BR /&gt;
Any ideas?&lt;BR /&gt;
&lt;BR /&gt;
Thanks again &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Fri, 19 Jan 2007 08:38:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857475#M22198</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-19T08:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get anonymous blocks' name?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857476#M22199</link>
      <description>Hi all,&lt;BR /&gt;
Thank God, I found a solution to my problem... I found the answer in this "Visual Basic Customization" thread:&lt;BR /&gt;
&lt;BR /&gt;
http://discussion.autodesk.com/thread.jspa?messageID=5240184&lt;BR /&gt;
&lt;BR /&gt;
After exploring the values contained in the XData property of my  blocks, I found the anonymous ones has a value named 'AcDbBlockRepBTag'. Fortunately, this lead me to the cited thread. There, I discovered that the &lt;B&gt;typed value&lt;/B&gt; with the &lt;B&gt;group code&lt;/B&gt; 1005 contained the handle to the 'real' BlockTableReference for the anonymous blocks in HEX format&lt;BR /&gt;
&lt;BR /&gt;
Anyway, I don't know why it happens this way... I mean: why this blocks are stored this way? How can I replicate this situation? Is it due to a wrong use of AutoCAD, dynamic blocks or else?&lt;BR /&gt;
&lt;BR /&gt;
It would be fantastic if at last I could understand why is it happening.&lt;BR /&gt;
&lt;BR /&gt;
Anyway, I want to thank you all for the given help (including the people who write the thread cited at this post)&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
&lt;BR /&gt;
Rubén Dopico</description>
      <pubDate>Mon, 22 Jan 2007 18:22:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-get-anonymous-blocks-name/m-p/1857476#M22199</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-22T18:22:31Z</dc:date>
    </item>
  </channel>
</rss>

