- 积分
- 73549
- 明经币
- 个
- 注册时间
- 2001-6-7
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2003-4-15 21:03:00
|
显示全部楼层
以下是在VBA中的示例,你自己改为VB下的吧
Sub MCCAD_GetSubEntity()
Dim Obj As AcadEntity
Dim ObjName As String
Dim ObjInsPnt As Variant
Dim ObjTxt As String
Dim PickedPoint As Variant, TransMatrix As Variant, ContextData As Variant
Dim HasContextData As String
On Error Resume Next
ThisDrawing.Utility.GetSubEntity Obj, PickedPoint, TransMatrix, ContextData, "选择图块中的文字:"
If Obj.ObjectName = "AcDbMText" Or Obj.ObjectName = "AcDbText" Then
ObjName = Obj.ObjectName
ObjInsPnt = Obj.InsertionPoint
ObjTxt = Obj.TextString
Debug.Print "======================"
Debug.Print "选定文字类型:" & ObjName
Debug.Print "选定文字插入点:X=" & ObjInsPnt(0) & " Y=" & ObjInsPnt(1)
Debug.Print "选定文字内容:" & ObjTxt
Debug.Print "====明经通道 http://www.mjtd.com===="
Else
Debug.Print "未选中文字"
End If
End Sub |
|