GetXData CAD using the read data (com interface)

The main use of Function:


MxDrawEntity::GetXData


Return extended data entities.


c # code to achieve the following:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
private void GetXData()
{
     MxDrawUtility mxUtility = new MxDrawUtility();
     MxDrawPoint point;
     MxDrawEntity ent = (MxDrawEntity)(mxUtility.GetEntity(out point, "选择要读扩展数据的实体:" ));
     if (ent == null )
     {
         return ;
     }
     MxDrawResbuf exData = ent.GetXData( "" );
  
     if (exData.Count == 0)
     {
         MessageBox.Show( "没有扩展数据" );
  
     }
     else
     {
         // 向命令行窗口打印扩展数据。
         exData.PrintData();
         MessageBox.Show(exData.AtString(1));
     }
}

Guess you like

Origin www.cnblogs.com/yzy0224/p/11023484.html