这里是另一个版本的相同的事情选择一个块,然后更新属性
- Public Sub ModifyLabelSTNcoords()
- ' adds x and y co ords of picked point to labelstn block
- Dim objENT As AcadEntity
- Dim pt1 As Variant
- Dim attribs As Variant
- On Error Resume Next
- ThisDrawing.Utility.GetEntity objENT, basepnt, "pick Label stn block : "
- attribs = objENT.GetAttributes
- pt1 = ThisDrawing.Utility.GetPoint(, " pick stn point")
- txtx1 = "E " + CStr(FormatNumber(pt1(0), 3))
- TXTY1 = "N " + CStr(FormatNumber(pt1(1), 3))
- TXTz1 = "RL " + CStr(FormatNumber(pt1(2), 3))
- attribs(2).TextString = txtx1
- attribs(2).Update
- attribs(3).TextString = TXTY1
- attribs(3).Update
- attribs(4).TextString = TXTz1
- attribs(4).Update
- End Sub
|