<?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: Explode a block containing the nested array in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9426963#M19865</link>
    <description>&lt;P&gt;The above solution turns array into a regular block. How to make this block still an array?&lt;/P&gt;</description>
    <pubDate>Tue, 07 Apr 2020 11:15:11 GMT</pubDate>
    <dc:creator>fsztuczny</dc:creator>
    <dc:date>2020-04-07T11:15:11Z</dc:date>
    <item>
      <title>Explode a block containing the nested array</title>
      <link>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9426670#M19863</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;How to correctly explode a block so that the nested array does not escape from its original place after calling ExplodeToOwnerSpace? My observations show that the array from the exploded block is shifted relative to the original by the double coordinates of the block insertion point (owner).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the original block. The colored elements are array:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Przechwytywanie.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/750823i9EB308D910A6A60A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Przechwytywanie.PNG" alt="Przechwytywanie.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After ExplodeToOwnerSpace:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Przechwytywanie2.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/750824i40418593D46D78AB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Przechwytywanie2.PNG" alt="Przechwytywanie2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Original drawing is attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can make a correction for arrays, but maybe there is another way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;		[CommandMethod( "testExplodeToOwnerSpace", CommandFlags.Modal )]
		public void testExplodeToOwnerSpace() // This method can have any name
		{
			// Put your command code here
			try
			{
				Database db = HostApplicationServices.WorkingDatabase;
				Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
				Editor ed = doc.Editor;
				PromptEntityOptions peo = new PromptEntityOptions( "\nPick a block: " );
				peo.SetRejectMessage( "\nThis is not a block!" );
				peo.AddAllowedClass( typeof( BlockReference ), true );
				PromptEntityResult per = ed.GetEntity( peo );
				if( per.Status != PromptStatus.OK )
				{
					return;
				}

				using( Transaction tr = doc.TransactionManager.StartTransaction() )
				{
					BlockTableRecord curSpc = tr.GetObject( db.CurrentSpaceId, OpenMode.ForWrite ) as BlockTableRecord;
					BlockReference blRef = tr.GetObject( per.ObjectId, OpenMode.ForWrite ) as BlockReference;
					blRef.ExplodeToOwnerSpace();
					blRef.Erase( true );
					tr.Commit();
				}
			}
			catch( System.Exception ex )
			{
				Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage( ex.ToString() );
			}
		}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 08:58:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9426670#M19863</guid>
      <dc:creator>fsztuczny</dc:creator>
      <dc:date>2020-04-07T08:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Explode a block containing the nested array</title>
      <link>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9426856#M19864</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Instead &lt;STRONG&gt;ExplodeToOwnerSpace&lt;/STRONG&gt;, another way is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;					DBObjectCollection oColl = new DBObjectCollection();
					blRef.Explode( oColl );
					foreach( DBObject obj in oColl )
					{
						Entity ent = obj as Entity;
						curSpc.AppendEntity( ent );
						tr.AddNewlyCreatedDBObject( ent, true );
					}
					oColl.Dispose();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works fine.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 10:28:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9426856#M19864</guid>
      <dc:creator>fsztuczny</dc:creator>
      <dc:date>2020-04-07T10:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Explode a block containing the nested array</title>
      <link>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9426963#M19865</link>
      <description>&lt;P&gt;The above solution turns array into a regular block. How to make this block still an array?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 11:15:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9426963#M19865</guid>
      <dc:creator>fsztuczny</dc:creator>
      <dc:date>2020-04-07T11:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Explode a block containing the nested array</title>
      <link>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9428791#M19866</link>
      <description>&lt;P&gt;Array itself is a special BlockReference entity with associatenetwork data applied. While it not only behaves like a dynamic block, its block definition is also an anonymous block definition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, when array is created from an entity (be it plan single entity, such as circle/line..., or a block reference, as in your case), that single entity would be converted into an block reference of an anonymous block.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, if you place the array into another block definition, the associatenetwork constraints in the array would be lost, the instance of the array would become only a block reference of an anonymous block definition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When executing command "EXPLODE" at command line against your block with former array block nested (now, just a block reference of an anonymous block, without associated array constraints), the result is the same as calling ExplodeToOwnerSpace() in your code: the "array" (just a regular block reference) would be gone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you call Explode() and add the exploded DBObejcts into the current space individually, the "array" would remain, as a regular block reference, no array's functionality (because it was lost when your block definition was defined). You could call Explode() recursively to break all block reference, but there would be no array any more.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 21:10:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9428791#M19866</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2020-04-07T21:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Explode a block containing the nested array</title>
      <link>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9428886#M19867</link>
      <description>&lt;P&gt;Thank you.&lt;BR /&gt;I'm aware of what array is and how it works roughly. I asked because the burst built-in command explodes so that the array retains its dynamic characteristics. Similarly, ExplodeToOwnerSpace. That's why I asked because I was looking for an alternative effective way. However, it looks like it will have to stay that way - for now. This is not a drama.&lt;BR /&gt;If I understand correctly, ExplodeToOwnerSpace work incorrectly? This is not an intentional feature that must be taken into account for some reason? The graphics are shifted, but the dynamic handles remain in place. I hope Autodesk notices the problem and releases the patch. This problem occurs on AC2012, 2014, 2018 (only these versions I have in the company).&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 21:53:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9428886#M19867</guid>
      <dc:creator>fsztuczny</dc:creator>
      <dc:date>2020-04-07T21:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Explode a block containing the nested array</title>
      <link>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9431456#M19868</link>
      <description>&lt;P&gt;Have you tried editing the nested associative array in your block definition using the BEDIT command?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2020 04:22:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9431456#M19868</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2020-04-09T04:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Explode a block containing the nested array</title>
      <link>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9439197#M19869</link>
      <description>&lt;P&gt;Yes. Arrays can be edited in the source block. If I burst it with the burst command, the arrays remain editable. If ExplodeToOwnerSpace(), they are also editable but shifted. If Explode() and added to the owner, it remains an anonymous block that contains the copied basic arrays components repeatedly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dwg drawing is shared a few posts above.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 13:23:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/explode-a-block-containing-the-nested-array/m-p/9439197#M19869</guid>
      <dc:creator>fsztuczny</dc:creator>
      <dc:date>2020-04-13T13:23:58Z</dc:date>
    </item>
  </channel>
</rss>

