- ' 函数
- Sub SetAttValue(AttEnt As AcadBlockReference, Tag As String, Value As String)
- Dim Att As AcadAttributeReference
- If AttEnt.HasAttributes = True Then
- Dim AttVal As Variant
- AttVal = AttEnt.GetAttributes
- Dim i As Integer
- For i = 0 To UBound(AttVal)
- If AttVal(i).TagString = Tag Then
- AttVal(i).TextString = Value
- End If
- Next i
- End If
- End Sub
- ' 例子
- Sub mjtd()
- Dim ent As AcadEntity
- Dim pnt As Variant
- ThisDrawing.Utility.GetEntity ent, pnt, "Get Block:"
- SetAttValue ent, "CLBJ", "mjtd.com"
- End Sub
|