把块当成一个集合 - Sub test()
- Dim blref As AcadBlockReference
- Dim pt As Variant
- ThisDrawing.Utility.GetEntity blref, pt
- Dim bl As AcadBlock
- Set bl = ThisDrawing.Blocks(blref.Name)
- Dim obj As AcadEntity
- For Each obj In bl
- If obj.ObjectName = "AcDbText" Then
- Dim text As AcadText
- Set text = obj
- text.TextString = "OK"
- End If
- Next
- blref.Update
- End Sub
|