AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to use selectionset?

1 REPLY 1
Reply
Message 1 of 2
Anonymous
351 Views, 1 Reply

how to use selectionset?

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.
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report