Тема: Вопрос к kpblc
Нашла Ваш код на http://vbamaker.narod.ru/Cod2.html. Попробовала, но он почему то не работает.
В чем ошибка???
'Получение атрибутов (редактируемых) блока и вывод их в MsgBox Sub GetBlockAttr() Dim objBlock As AcadBlock, objBlockRef As AcadBlockReference Dim objAttr As AcadAttribute Dim SelSet As AcadSelectionSet Dim SelBlock As AcadBlockReference Dim sSelSetName As String, sBlockAttr As String Dim filterType(0) As Integer Dim filterData(0) As Variant Dim blcAttr As Variant Dim blcAttrCounter As Long, lCounter As Long filterType(0) = 0 filterData(0) = "INSERT" sSelSetName = "SelectionForGetBlockAttr" For lCounter = 0 To ThisDrawing.SelectionSets.Count If ThisDrawing.SelectionSets.Item(lCounter).Name = sSelSetName Then ThisDrawing.SelectionSets.Item(lCounter).Clear ThisDrawing.SelectionSets.Item(lCounter).Delete Exit For End If Next 'lCounter Set SelSet = ThisDrawing.SelectionSets.Add(sSelSetName) SelSet.SelectOnScreen sBlockAttr = "" For lCounter = 1 To SelSet.Count Set SelBlock = SelSet.Item(lCounter - 1) blcAttr = SelBlock.GetAttributes For blcAttrCounter = LBound(blcAttr) To UBound(blcAttr) sBlockAttr = sBlockAttr + "; Tag: " + blcAttr(blcAttrCounter).TagString + _ "; Value: " + blcAttr(blcAttrCounter).TextString Next 'blcAttrCounter sBlockAttr = sBlockAttr + vbCr Next 'lCounter 'Удаление SelSet SelSet.Clear SelSet.Delete MsgBox sBlockAttr End Sub