• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Valued Contributor
    Posts: 64
    Registered: ‎04-04-2012
    Accepted Solution

    Selecting Entities in multiple layers

    76 Views, 1 Replies
    01-15-2013 01:58 AM

    ObjectARX 2007

     

    Is it possible to select entities of multiple layers?

    I've looked at...

    http://through-the-interface.typepad.com/through_the_interface/2008/07/conditional-sel.html

    ...and tried the following code.

     

    string[] layerNames = {"1", "2", "3"};
    TypedValue[] tdv = new TypedValue[(layerNames.Length * 3) + 2];
    
    int i = 0;
    tdv[i++] = new TypedValue((int)DxfCode.Operator, "<or");
    foreach (string ln in layerNames)
    {
        tdv[i] = new TypedValue((int)DxfCode.Operator, "<and");
        tdv[i + 1] = new TypedValue((int)DxfCode.LayerName, ln);
        tdv[i + 2] = new TypedValue((int)DxfCode.Operator, "and>");
        i += 3;
    }
    tdv[i - 2] = new TypedValue((int)DxfCode.Operator, "or>");
    
    SelectionFilter sf = new SelectionFilter(tdv);
    PromptSelectionResult psr = ed.SelectAll(sf);

     This code gives me an error in the PromptSelectionResult.

    What would cause the erro?

    Or would there be a better way?

    Please use plain text.
    Moderator
    Alexander.Rivilis
    Posts: 1,175
    Registered: ‎04-09-2008

    Re: Selecting Entities in multiple layers

    01-15-2013 02:53 AM in reply to: dynamicscope

    What about:

    TypedValue((int)DxfCode.LayerName, "1,2,3");

    ?


    Пожалуйста не забывайте про Утвердить в качестве решения!Утвердить в качестве решения и Give Kudos!Баллы
    Please remember to Accept Solution!Accept as Solution and Give Kudos!Kudos

    Please use plain text.