1个回答
展开全部
Sub tellmestringposition()
Dim t As AcadMText
Dim myset As AcadSelectionSet
For Each myset In ThisDrawing.SelectionSets
If myset.Name = "aaa" Then
ThisDrawing.SelectionSets.Item("aaa").Delete
End If
Exit For
Next
Set myset = ThisDrawing.SelectionSets.Add("aaa")
myset.SelectOnScreen
For j = 0 To myset.Count - 1
If myset(j).ObjectName = "AcDbMText" Then
Set t = myset(0)
MsgBox "插入点X坐标为:" & Round(t.InsertionPoint(0), 0) & vbLf & "插入点Y坐标为:" & Round(t.InsertionPoint(1), 0)
End If
Next
End Sub
Dim t As AcadMText
Dim myset As AcadSelectionSet
For Each myset In ThisDrawing.SelectionSets
If myset.Name = "aaa" Then
ThisDrawing.SelectionSets.Item("aaa").Delete
End If
Exit For
Next
Set myset = ThisDrawing.SelectionSets.Add("aaa")
myset.SelectOnScreen
For j = 0 To myset.Count - 1
If myset(j).ObjectName = "AcDbMText" Then
Set t = myset(0)
MsgBox "插入点X坐标为:" & Round(t.InsertionPoint(0), 0) & vbLf & "插入点Y坐标为:" & Round(t.InsertionPoint(1), 0)
End If
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询