[求助]vb-autocad2000
版主你好,第一次向你求助,谢谢!条件:图形中有一块Test,其中有2个文字(1和2)
问题:怎样在vb中可以获得文字1的相关属性(通过在cad中“鼠标点击文字1”)
以下是在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
问题终于在版主的帮助下解决,非常感谢!
问题终于在版主的帮助下解决,非常感谢!谢谢!
页:
[1]