代码如下:
Dim BlkRef As AcadBlockReference
Dim SelSet As AcadSelectionSet
Set SelSet = AcadDoc.SelectionSets.Add("SelSet1")
Dim aaa(0) As Integer 'Select 条件1:选择类型
Dim aaa1(0) As Variant 'select 条件2:选择图元
Dim maxPoint As Variant
Dim minPoint As Variant
aaa(0) = 0 '图元类型
aaa1(0) = "INSERT" '图块
SelSet.Select acSelectionSetAll, , , aaa, aaa1 '选择所有图块
For Each BlkRef In SelSet
Debug.Print BlkRef.Name
BlkRef.GetBoundingBox minPoint, maxPoint
Next