GetxDataString CAD using the read data (com interface)

The main use of Function:


MxDrawEntity::GetxDataString2


Reading a character extension data as detailed below:


parameter Explanation

[in] LONG lItem

The value of the location

[out, retval] BSTR* pRet

Returns the value of the variable

szAppName

Extended data Name


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
private void ReadXData()
{
     MxDrawUtility mxUtility = new MxDrawUtility();
     MxDrawPoint point;
     MxDrawEntity selEnt = (MxDrawEntity)(mxUtility.GetEntity(out point, "选择要写扩展数据的对象" ));
  
     if (selEnt == null )
         return ;
  
     string val = selEnt.GetxDataString2( "ExDataName" , 0);
     if (axMxDrawX1.IsOk())
     {
         MessageBox.Show(val);
     }
     else
     {
         MessageBox.Show( "没有扩展数!" );
     }
}

Guess you like

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