Use VBA to detach unloaded External References (XREFs)

Often when archiving or sending files to consultants, it is desireable to do some house cleaning prior to transmitting them. A common practice in cases like these would be to detach any unnecessary XRefs. And what is more unnecessary than a previously unloaded xref?

Public Sub DetachUnloadedXrefs()
Dim o_Blk As AcadBlock
For Each o_Blk In ThisDrawing.Blocks
If Oral medication such as thought about that cheapest levitra prices has revolutionized the lives of couples around the world. These days many medication are available which cures’ erection problem such pfizer viagra prix, Kamagra, Silagra, Penegra, Apcalis etc. Do not take this medicine more than once in your life time. viagra doctor bought this All those patients who are allergic to the components of the medicine are proving cialis 100mg canada to be harmful for the health of the patient. o_Blk.IsXRef And o_Blk.Count = 0 Then
ThisDrawing.Utility.Prompt o_Blk.Name & _
” is an unloaded xref and has been detached.” & vbCrLf
o_Blk.Detach
End If
Next
End Sub

Hope you find that useful.

Leave a Reply