程序功能:对已知块进行属性输出。
程序:
Public blkColl As AcadBlocks
Public BlkObj As AcadBlock
Public mspace As AcadModelSpace Public count As Integer Public I As Integer Public elem As Object Public subelem As Object
Private Sub CommandButton1_Click()
Set mspace = ThisDrawing.ModelSpace
Set blkColl = ThisDrawing.Blocks
count = blkColl.count
ListBox1.Clear For I = 0 To count - 1 ListBox1.AddItem blkColl.Item(I).Name Next
For Each elem In blkColl If elem.Name = "DATA" Then For Each subelem In elem Label2.Caption = subelem.TagString Label1.Caption = subelem.TextString Label3.Caption = subelem.PromptString Next End If Next
End Sub
其中块名为“DATA”;
问题:subelem.TextString中只能显示先前的块属性,在cad中修改后的块属性却无法显示。
请帮我找找问题!
谢谢!
Dim EntAtt As Variant EntAtt = elem.GetAttributes
Dim i
For i=LBound(EntAtt ) to Ubound(EntAtt ) Label2.Caption = EntAtt(i) .TagString Label1.Caption = EntAtt(i).TextString Label3.Caption = EntAtt(i).PromptString Next