Selection of multiple nested entities

Selection of multiple nested entities

Anonymous
Not applicable
2,306 Views
7 Replies
Message 1 of 8

Selection of multiple nested entities

Anonymous
Not applicable

There are blocks in the drawing, each containing several nested entities. Need a command which would find all the nested entities which got into the selection area provided by user (not necessary to select entities, just get the ids). GetNestedEntity() does what I need but for a single entity only. 

 

Selection of 'Trim' command does exactly what I need. How could I achieve the same behaviour?

 

Thank you.

0 Likes
2,307 Views
7 Replies
Replies (7)
Message 2 of 8

Alexander.Rivilis
Mentor
Mentor

@Anonymous wrote:

... not necessary to select entities, just get the ids ...


It is easy to iterate BlockTableRecode and get all ObjectId's of subentities (except constant AttributeDefinition) 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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

0 Likes
Message 3 of 8

Anonymous
Not applicable

I don't need all subentities, just those selected by user.

0 Likes
Message 4 of 8

Alexander.Rivilis
Mentor
Mentor

Ok. What about Editor.GetSelection with argument PromptSelectionOptions with properties AllowSubSelections and ForceSubSelections equal true?

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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

0 Likes
Message 5 of 8

Anonymous
Not applicable

Doesn't work. Even blocks can not be selected in this case.

 

Have found similar question here, but it was not answered 😞

http://forums.autodesk.com/t5/NET/Select-Nested/m-p/2046216/highlight/true#M7899

0 Likes
Message 6 of 8

Alexander.Rivilis
Mentor
Mentor

It is look you are right. IMHO only way is using pure ObjectARX (not AutoCAD .NET API) like this: http://adndevblog.typepad.com/autocad/2012/08/acedssget-multi-select-in-n-mode.html

Or using P/Invoke in .NET to call acedSSGet(L"_N:U:D",...); 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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

0 Likes
Message 7 of 8

Civil3DReminders_com
Mentor
Mentor

any chance of getting the sample code from the dead link from the comment in the linked post?

http://adn-cis.org/forum/index.php?topic=7683.msg25135#msg25135

 

Thank you

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
0 Likes
Message 8 of 8

norman.yuan
Mentor
Mentor

@Civil3DReminders_com :

 

If you are still interested in selecting multiple nested entities, see if these 2 articles are of help (pure .NET API solution):

 

https://drive-cad-with-code.blogspot.com/2019/08/select-multiple-nested-entities-1.html

https://drive-cad-with-code.blogspot.com/2019/08/selecting-multiple-nested-entities-2-of.html

 

Norman Yuan

Drive CAD With Code

EESignature