how to add context menu to the specific BlockReference

how to add context menu to the specific BlockReference

Anonymous
Not applicable
644 Views
2 Replies
Message 1 of 3

how to add context menu to the specific BlockReference

Anonymous
Not applicable

I hope to add the context menu to the Blockreference and on the  specific Layrer(eg,the block on the TestLayer show contextmenu)

how to do?

private static ContextMenuExtension menuExtension;       
        internal static void Attach()
        {
            menuExtension = new ContextMenuExtension();
            MenuItem item = new MenuItem("To Red");
            item.Click += new EventHandler(item_Click);
            menuExtension.MenuItems.Add(item);
       =>     RXClass rxClass = Entity.GetClass(typeof(BlockReference));
.....=>(how to add Layer filter)
            Application.AddObjectContextMenuExtension(rxClass, menuExtension);
        }
0 Likes
Accepted solutions (1)
645 Views
2 Replies
Replies (2)
Message 2 of 3

Alexander.Rivilis
Mentor
Mentor
Accepted solution

IMHO this topic can help you: http://adndevblog.typepad.com/autocad/2012/06/enabledisable-object-context-menu-for-specific-entity....

Only instead of checking Xdata you have to check layer name.

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

Anonymous
Not applicable

@Alexander.Rivilis thank you very much! it's what I need.

0 Likes