CAD使用GetxDataDouble读数据(com接口)

主要用到函数说明:

 

MxDrawEntity::GetxDataDouble2

 

读取一个Double扩展数据,详细说明如下:

 

参数说明

[in] LONG lItem

该值所在位置

[out, retval] BSTR* pRet

返回该变量值

szAppName

扩展数据名称

 

C#代码实现如下:

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
private void GetxDataDouble()
{
    MxDrawUtility mxUtility = new MxDrawUtility();
    MxDrawPoint point;
    MxDrawEntity selEnt = (MxDrawEntity)(mxUtility.GetEntity(out point, "选择要写扩展数据的对象"));
  
    if (selEnt == null)
        return;
  
    double val = selEnt.GetxDataDouble2("ExDataName", 0);
    if (axMxDrawX1.IsOk())
    {
        MessageBox.Show(val.ToString());
    }
    else
    {
        MessageBox.Show("没有扩展数!");
    }
}

posted on 2019-06-14 16:01  梦想CAD控件  阅读(152)  评论(0)    收藏  举报

导航