CAD使用SetxDataDouble写数据(com接口)

主要用到函数说明:

 

MxDrawEntity::SetxDataDouble

 

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

 

参数 说明

[in] BSTR val

字符串值

szAppName

扩展数据名称

nItem

扫描二维码关注公众号,回复: 6473782 查看本文章

该值所在位置

C#代码实现如下:

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
private void SetxDataDouble()
{
     MxDrawUtility mxUtility =  new  MxDrawUtility();
     MxDrawPoint point;
     MxDrawEntity selEnt = (MxDrawEntity)(mxUtility.GetEntity(out point,  "选择要写扩展数据的对象" ));
  
     if  (selEnt ==  null )
         return ;
     if  (selEnt.SetxDataDouble( "ExDataName" , 0, 55.5))
     {
         MessageBox.Show( "写扩展数据成功" );
     }
     else
     {
         MessageBox.Show( "写扩展数据失败" );
     }
}

猜你喜欢

转载自www.cnblogs.com/yzy0224/p/11023780.html