Here's some VBA to do a similar thing. Just delete the lines with the info that's not required.
Code:
Sub Blocks(row, col)
Dim BlocksSelSet As AcadSelectionSet
Dim blockref As AcadBlockReference
Dim AttRef As Variant
Dim I As Integer
Dim gpCode(0) As Integer
Dim dataValue(0) As Variant
Dim groupCode As Variant, dataCode As Variant
Dim NumOfBlocks As Integer
Dim mode
Dim AttMode As Long
Dim constant As String
Dim currentmode As Integer
Dim attrobject As AcadAttribute
On Error Resume Next
Set BlocksSelSet = ThisDrawing.SelectionSets.Add("All_Blocks")
'define type of selection set (crossing, window, etc, in this case, all)
mode = acSelectionSetAll
'this is a selection set filter
gpCode(0) = 0
dataValue(0) = "Insert"
groupCode = gpCode
dataCode = dataValue
'this collects all blocks into the seletion set
BlocksSelSet.Select mode, , , groupCode, dataCode
NumOfBlocks = BlocksSelSet.Count
For x = 1 To NumOfBlocks
Set blockref = BlocksSelSet(x)
excelsheet.Cells(row, col).Value = blockref.Name
excelsheet.Cells(row, col + 1).Value = blockref.layer
excelsheet.Cells(row, col + 2).Value = Format(blockref.insertionPoint(0), "##,##0.00") & "," & Format(blockref.insertionPoint(1), "##,##0.00")
row = row + 1
AttRef = blockref.GetAttributes
For I = LBound(AttRef) To UBound(AttRef)
Set attrobject = AttRef(I)
' Do something with the attribute refs here.
excelsheet.Cells(row, col).Value = AttRef(I).TagString
excelsheet.Cells(row, col + 1).Value = AttRef(I).layer
excelsheet.Cells(row, col + 3).Value = AttRef(I).TextString
constant = Choose(attrobject.mode, "acAttributeModeInvisible", "acAttributeModeConstant", "", "acAttributeModeVerify", "", "", "", "acAttributeModePreset")
row = row + 1
Next
Next
row = row + 1
'clean up
BlocksSelSet.Clear
BlocksSelSet.Delete
rownum = row
End Sub
Dave
Bookmarks