<?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 Explode help in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/explode-help/m-p/3027546#M60866</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Dear sirs,&lt;/DIV&gt;&lt;DIV&gt;Below is my code to bind all xrefs in current drawing.&lt;/DIV&gt;&lt;DIV&gt;(assumed that there is no nested xref)&lt;/DIV&gt;&lt;DIV&gt;Now i want to explode all of that binded xrefs(block references).&lt;/DIV&gt;&lt;DIV&gt;anyone can help me this?&lt;/DIV&gt;&lt;DIV&gt;--------------------------------------------------------------------------------------&lt;/DIV&gt;&lt;DIV&gt;Public Sub BindXrefDwgs()&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc = Application.DocumentManager.MdiActiveDocument&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; db = doc.Database&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Using docklock As DocumentLock = doc.LockDocument()&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Using DWGMTrans As Transaction = db.TransactionManager.StartTransaction&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim XrefGr As XrefGraph = db.GetHostDwgXrefGraph(True)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim XrefGrCol As GraphNodeCollection = New GraphNodeCollection&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim xrefdwgs As New ObjectIdCollection&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim index As Integer = 0&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For index = 0 To XrefGr.NumNodes&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XrefGrCol.Add(XrefGr.GetXrefNode(index))&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For Each XrefGrNode As XrefGraphNode In XrefGrCol&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If XrefGrNode.XrefStatus &amp;lt;&amp;gt; XrefStatus.FileNotFound Then&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xrefdwgs.Add(XrefGrNode.BlockTableRecordId)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Try&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; db.BindXrefs(xrefdwgs, False) 'bind&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Catch&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Finally&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DWGMTrans.Commit()&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DWGMTrans.Dispose()&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Try&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Using&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Using&lt;/DIV&gt;&lt;DIV&gt;End Sub&lt;/DIV&gt;&lt;DIV&gt;--------------------------------------------------------------------------------------&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 May 2011 00:43:09 GMT</pubDate>
    <dc:creator>ProfWolfMan</dc:creator>
    <dc:date>2011-05-18T00:43:09Z</dc:date>
    <item>
      <title>Explode help</title>
      <link>https://forums.autodesk.com/t5/net-forum/explode-help/m-p/3027546#M60866</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Dear sirs,&lt;/DIV&gt;&lt;DIV&gt;Below is my code to bind all xrefs in current drawing.&lt;/DIV&gt;&lt;DIV&gt;(assumed that there is no nested xref)&lt;/DIV&gt;&lt;DIV&gt;Now i want to explode all of that binded xrefs(block references).&lt;/DIV&gt;&lt;DIV&gt;anyone can help me this?&lt;/DIV&gt;&lt;DIV&gt;--------------------------------------------------------------------------------------&lt;/DIV&gt;&lt;DIV&gt;Public Sub BindXrefDwgs()&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc = Application.DocumentManager.MdiActiveDocument&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; db = doc.Database&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Using docklock As DocumentLock = doc.LockDocument()&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Using DWGMTrans As Transaction = db.TransactionManager.StartTransaction&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim XrefGr As XrefGraph = db.GetHostDwgXrefGraph(True)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim XrefGrCol As GraphNodeCollection = New GraphNodeCollection&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim xrefdwgs As New ObjectIdCollection&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim index As Integer = 0&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For index = 0 To XrefGr.NumNodes&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XrefGrCol.Add(XrefGr.GetXrefNode(index))&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For Each XrefGrNode As XrefGraphNode In XrefGrCol&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If XrefGrNode.XrefStatus &amp;lt;&amp;gt; XrefStatus.FileNotFound Then&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xrefdwgs.Add(XrefGrNode.BlockTableRecordId)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Try&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; db.BindXrefs(xrefdwgs, False) 'bind&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Catch&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Finally&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DWGMTrans.Commit()&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DWGMTrans.Dispose()&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Try&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Using&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Using&lt;/DIV&gt;&lt;DIV&gt;End Sub&lt;/DIV&gt;&lt;DIV&gt;--------------------------------------------------------------------------------------&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2011 00:43:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/explode-help/m-p/3027546#M60866</guid>
      <dc:creator>ProfWolfMan</dc:creator>
      <dc:date>2011-05-18T00:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Explode help</title>
      <link>https://forums.autodesk.com/t5/net-forum/explode-help/m-p/3028640#M60867</link>
      <description>&lt;P&gt;If you just want to explode the main Xref block and place all the resulting objects in Model or Paper space, then you just open the BlockReference and call ExplodeToOwnerSpace()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want more control over the objects, or want to explode nested blocks or whatever, then you open the BlockReference and call bref.Explode(DbObjectCollection).&amp;nbsp; You pass it an empty DbObjectCollection and the resulting objects created by the Explode are put into the Collection.&amp;nbsp; Then you are responsible for both Adding those objects to the Database and erasing the&amp;nbsp;original object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have never used ExplodeToOwnerSpace, so I am not sure, but I think in that case you would also be responsible for erasing the&amp;nbsp;original object, but the exploded objects are automatically added to whatever the parent BlockTableRecord was.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2011 17:50:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/explode-help/m-p/3028640#M60867</guid>
      <dc:creator>chiefbraincloud</dc:creator>
      <dc:date>2011-05-18T17:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Explode help</title>
      <link>https://forums.autodesk.com/t5/net-forum/explode-help/m-p/3032532#M60868</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i wrote a procedure to explode all block references.&lt;/P&gt;&lt;P&gt;But i got error msg as eCannotScaleNonUniformly.&lt;/P&gt;&lt;P&gt;I have uniformly scaled blocks only. Below is my code.&lt;/P&gt;&lt;P&gt;Anyone can help me, please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;note: code is attached.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2011 05:37:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/explode-help/m-p/3032532#M60868</guid>
      <dc:creator>ProfWolfMan</dc:creator>
      <dc:date>2011-05-23T05:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Explode help</title>
      <link>https://forums.autodesk.com/t5/net-forum/explode-help/m-p/3032562#M60869</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now i try some other way using 'explodetoownerspace'.&lt;/P&gt;&lt;P&gt;but i did not achive result.&lt;/P&gt;&lt;P&gt;i got 'einvalidinput' error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please help me.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2011 06:44:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/explode-help/m-p/3032562#M60869</guid>
      <dc:creator>ProfWolfMan</dc:creator>
      <dc:date>2011-05-23T06:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Explode help</title>
      <link>https://forums.autodesk.com/t5/net-forum/explode-help/m-p/3035242#M60870</link>
      <description>&lt;P&gt;This worked for me with non-uniformed scaled blocks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        &amp;lt;CommandMethod("ExplodeBlocks")&amp;gt; _
        Public Sub ExplodeBlocks()
            Dim doc As Document = Application.DocumentManager.MdiActiveDocument
            Dim db As Database = doc.Database
            Dim ed As Editor = doc.Editor

            Using trx As Transaction = db.TransactionManager.StartTransaction

                Dim bt As BlockTable = db.BlockTableId.GetObject(OpenMode.ForRead)

                For Each btrObjId As ObjectId In bt

                    Dim btr As BlockTableRecord = btrObjId.GetObject(OpenMode.ForRead)

                    If btr.IsLayout Or btr.IsAnonymous Then
                        Continue For
                    End If
                    Dim objIdColl As ObjectIdCollection = btr.GetBlockReferenceIds(True, True)

                    For Each objId As ObjectId In objIdColl
                        Dim acBref As BlockReference = objId.GetObject(OpenMode.ForWrite)
                        MsgBox(acBref.Name)
                        acBref.ExplodeToOwnerSpace()
                    Next
                Next
                trx.Commit()
            End Using
        End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2011 04:08:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/explode-help/m-p/3035242#M60870</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-25T04:08:31Z</dc:date>
    </item>
  </channel>
</rss>

