以下是我一个遍历块的程序,供参考。
Sub RefBind()
Dim BlockObj As AcadBlock
Dim I As Integer
For Each BlockObj In ThisDrawing.Blocks
If BlockObj.IsXRef Then
BlockObj.Bind False
I = I + 1
End If
Next
ActiveDocument.Utility.Prompt vbLf & I & " external reference(s) bound" & vbCr