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