CAD与用户交互在图面上选择一个实体(com接口VB语言)

主要用到函数说明:


IMxDrawUtility::GetEntity


与用户交互到在图面上选择一个实体,详细说明如下:


参数 说明

[out] IMxDrawPoint** pPickPoint

返回实体的选择点

[in] BSTR prompt

选择实体时的提示字符串


代码实现如下:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
 
Dim xData As MxDrawXLib.MxDrawResbuf
 
 
Set xData = ent.GetXData("")
 
If (xData.Count = 0) Then
     MsgBox "没有扩展数据"
Else
     xData.PrintData
End If

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

导航