CAD delete the selected label (Web version)

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/u013725001/article/details/91413654

The main use of Function:

 

IMxDrawSelectionSet::Select2

 

Configuration selection set. Details are as follows:

 

parameter Explanation

[in] MCAD_McSelect Mode

Construction mode selection set

[in] VARIANT point1

Configuration at the selected time required to select the object set point

[in] VARIANT point2

Configuration at the selected time required to select the object set point

[in,optional] VARIANT filterType

Type filter selection set configuration data

[in,optional] VARIANT filterData

Filter set selection data structure

You can take the following values

mcSelectionSetWindow = 0, mcSelectionSetCrossing = 1, mcSelectionSetFence = 2, mcSelectionSetPrevious = 3, mcSelectionSetLast = 4, mcSelectionSetAll = 5, select all entities FIG surface mcSelectionSetWindowPolygon = 6, mcSelectionSetCrossingPolygon = 7, mcSelectionSetUserSelect = 8 mcSelectionImpliedSelectSelect = 9, _I FIG return current the entity that has been selected

 

js used as follows:

 

function DelComment()

{

 

 var  ss = mxOcx.NewSelectionSet();

   var spFilte = mxOcx.NewResbuf();

 

   // 把批注对象,当着过滤条件.

   spFilte.AddStringEx("MxComment,MxDrawXCustomEntity", 5020);

 

   // 与用户交互,得到批注.

   ss.Select2(8,null,null,null,spFilte);

 

 

   // 遍历每个文字.

   var bFind = false;

   for (var i = 0; i < ss.Count; i++) {

       var ent = ss.Item(i);

       if (ent == null)

           continue;

       if (ent.ObjectName == "McDbComment"

        || ent.ObjectName == "MxDrawXCustomEntity"

        {

           // 得到批注对象。

           ent.Erase();

       }

   }

}

Guess you like

Origin blog.csdn.net/u013725001/article/details/91413654