.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Selecting Entities in multiple layers

1 REPLY 1
SOLVED
Reply
Message 1 of 2
dynamicscope
424 Views, 1 Reply

Selecting Entities in multiple layers

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?

1 REPLY 1
Message 2 of 2

What about:

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

?

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost