vba如何得到文字插入点的x及y坐标
答案:2 悬赏:10 手机版
解决时间 2021-03-06 04:18
- 提问者网友:城市野鹿
- 2021-03-05 18:12
已解答,文字对象属性有 Insertionpoint项,前面没查到
最佳答案
- 五星知识达人网友:迟山
- 2021-03-05 18:37
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
全部回答
- 1楼网友:深街酒徒
- 2021-03-05 19:05
dim arr(1 to 2, 1 to 3 ) as integer
arr(1,1)=1 arr(2,1)=2
arr(1,2)=2 arr(2,2)=3
arr(1,3)=3 arr(2,3)=4
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯