主要用到函数说明:IMxDrawSelectionSet::Select2

构造选择集。详细说明如下:

参数

说明

[in] MCAD_McSelect Mode

构造选择集方式

[in] VARIANT point1

构造择择集时需要使用到的点对象

[in] VARIANT point2

构造择择集时需要使用到的点对象

[in,optional] VARIANT filterType

构造选择集的过滤数据的类型

[in,optional] VARIANT filterData

构造选择集的过滤数据

可以取如下值

mcSelectionSetWindow = 0, mcSelectionSetCrossing = 1, mcSelectionSetFence = 2, mcSelectionSetPrevious = 3, mcSelectionSetLast = 4, mcSelectionSetAll = 5, 选择图面上的所有实体 mcSelectionSetWindowPolygon = 6, mcSelectionSetCrossingPolygon = 7, mcSelectionSetUserSelect = 8 mcSelectionImpliedSelectSelect = 9,_I 返回当前图上已经选择的实体

js中使用如下:

var ssGet = mxOcx.NewSelectionSet();

var filter = mxOcx.NewResbuf();

filter.AddStringEx("<OR", -4);

filter.AddStringEx("1", 8);

filter.AddStringEx("2", 8);

filter.AddStringEx("OR>", -4);



var mxUtility = mxOcx.NewUtility();

mxUtility.Prompt("n 选择实体:");

ssGet.Select2(8, null, null, null, filter);



var sTip = "选择了" + ssGet.Count + "个实体";

alert(sTip);