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