CAD得到多行文本(com接口VB语言)

主要用到函数说明:


MxDrawXCustomFunction::Mx_GetMTextContent


得到多行文本的,不包括格式控制符中的字符串值,详细说明如下:


参数 说明

LONG lId

多行文本的id


代码实现如下:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
If iCommandId = 1 Then
      Set mxUtility = New MxDrawXLib.MxDrawUtility
      Dim getPt As MxDrawXLib.MxDrawPoint
      Set ent = mxUtility.GetEntity(getPt, Chr(13) + Chr(10) + "选择多行文字:")
 
      If (ent Is Nothing) Then
           MsgBox "没有选择实体.."
           Exit Sub
      End If
 
 
        If TypeOf ent Is MxDrawXLib.MxDrawMText Then
               '当前实体是个文字实体
 
 
                  Dim ret As MxDrawResbuf
 
               Set ret = MxDrawX1.CallLongParam1("Mx_GetMTextContent", ent.ObjectID)
 
               If ret.AtString(0) = "Ok" Then
                    MsgBox (ret.AtString(1))
               End If
 
       End If

posted on 2019-06-11 16:21  梦想CAD控件  阅读(306)  评论(0)    收藏  举报

导航