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

主要用到函数说明:


MxDrawEntity::SetxDataLong


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


参数 说明

[in] BSTR val

字符串值

szAppName

扩展数据名称

nItem

该值所在位置


c#代码实现如下:


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

猜你喜欢

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