blockreference getattributes
依据块名TBZ00,想用blockreference getattributes读出tagstring和textstring,但getattributes报错,帮忙看看I = acaddoc.Blocks.Count
MsgBox (I)
For k = 1 To I
s = acaddoc.Blocks.Item(k - 1).Name
If UCase(s) = "TBZ00" Then
Exit For
End If
Next
Dim ent As AcadBlockReference
Dim s1 As Variant
s1 = ent.GetAttributes----出错:块或变量with未定义
For I = LBound(s1) To UBound(s1)
If UCase(s1(I).TagString) = "DRAWNO" Then
s = s1(I).TextString
End If
Next ent没有赋值,应该要通过遍历模型空间来查找块,这里的块是块引用对象,而不是块集合中的块对象。
页:
[1]