I want to select entity by assiging layername and entitytype.But the seletioncount is always 0.I'donn't konw how why?Please help me! Thanks you very much!
object select2 = null;
object basePnt2 = null;
acadApp.ActiveDocument.Utility.GetEntity(out select2, out basePnt2, "select entity:");
AcadEntity matchEntity = select2 as AcadEntity;
short[] filterType = new short[2];
object[] filterData = new object[2];
AcadSelectionSet acset2 = acadApp.ActiveDocument.SelectionSets.Add("acset2");
//assinType and layer
filterType[0] = 0;
filterData[0] = matchEntity.ObjectName;
filterType[1] = 8;
filterData[1] = matchEntity.Layer;
acset2.Select(AcSelect.acSelectionSetAll, null, null, filterType, filterData);
acset2.Highlight(true);//高亮显示
acadApp.ActiveDocument.Utility.Prompt("共选择对象:" + acset2.Count.ToString());
//acset2.count always return 0.In fact,it should return 3.