How to disable perticular command for custom entity

How to disable perticular command for custom entity

Anonymous
Not applicable
862 Views
7 Replies
Message 1 of 8

How to disable perticular command for custom entity

Anonymous
Not applicable

Hello everyone,

 

                This is my first post so all feedbacks are welcome. I have created a custom entity derived from AdDbEntity and I want some commands (such as "explode") not to work on the custom entity (Disabled). Is this possible? If yes how?

 

Thanks in Advance.

0 Likes
Accepted solutions (1)
863 Views
7 Replies
Replies (7)
Message 2 of 8

owenwengerd
Advisor
Advisor
Just return an error code from your entity's subExplode() implementation.
--
Owen Wengerd
ManuSoft
0 Likes
Message 3 of 8

Anonymous
Not applicable

Owen,

 

           Thanks for suggestion. I have already considered that, but I need to block a couple of commands such as "Explode", "trim" etc. Therefore I was looking for something general and globally applicable. Is it possible to override the functionality of commands for perticular objects (custom entity).

 

          And can you please also tell the GroupName of EXPLODE command. Or where I can get this type of information?

 

Thanks for your reply.

0 Likes
Message 4 of 8

Alexander.Rivilis
Mentor
Mentor

In general, it is impossible to prohibit AutoCAD commands to work on custom entity from DBX-module. This can be done in the ARX-module using reactors (such as AcEdInputContextReactor, AcEdSSGetFilter, AcEditorReactor, etc.)

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

Alexander.Rivilis

 

               Thanks for suggestion. Can you please be more specific and if possible give me some code snippet. Basically I need to prevent those actions on custom entity and using reactors all we get is a notification, not control to bypass command. Is there something to do the same.

 

Thanks.

0 Likes
Message 6 of 8

Alexander.Rivilis
Mentor
Mentor
Accepted solution

This is simple sample.

Array of disabled command and array of checked classes defined in function Initialize:

void Initialize()
{
  commands.append(_T("MOVE"));
  commands.append(_T("TRIM"));
  commands.append(_T("EXPLODE"));
  commands.append(_T("LENGTHEN"));
  classNames.append(AcDbLine::desc());
  classNames.append(AcDbCircle::desc());
  classNames.append(AcDbArc::desc());
}

 

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

Message 7 of 8

Anonymous
Not applicable

Alexander.Rivilis

 

           Thank you very much for the solution. It's kind of what I was looking for. Smiley Happy

 Thanks for your precious time.

 

Regards,

Piyush_stiff

0 Likes
Message 8 of 8

Alexander.Rivilis
Mentor
Mentor

Last version of code here.

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