Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear sirs,
Below is my code to bind all xrefs in current drawing.
(assumed that there is no nested xref)
Now i want to explode all of that binded xrefs(block references).
anyone can help me this?
--------------------------------------------------------------------------------------
Public Sub BindXrefDwgs()
doc = Application.DocumentManager.MdiActiveDocument
db = doc.Database
Using docklock As DocumentLock = doc.LockDocument()
Using DWGMTrans As Transaction = db.TransactionManager.StartTransaction
Dim XrefGr As XrefGraph = db.GetHostDwgXrefGraph(True)
Dim XrefGrCol As GraphNodeCollection = New GraphNodeCollection
Dim xrefdwgs As New ObjectIdCollection
Dim index As Integer = 0
For index = 0 To XrefGr.NumNodes
XrefGrCol.Add(XrefGr.GetXrefNode(index))
Next
For Each XrefGrNode As XrefGraphNode In XrefGrCol
If XrefGrNode.XrefStatus <> XrefStatus.FileNotFound Then
xrefdwgs.Add(XrefGrNode.BlockTableRecordId)
End If
Next
Try
db.BindXrefs(xrefdwgs, False) 'bind
Catch
Finally
DWGMTrans.Commit()
DWGMTrans.Dispose()
End Try
End Using
End Using
End Sub
--------------------------------------------------------------------------------------
Thanks & Regards,
G
G
Solved! Go to Solution.