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

how to add context menu to the specific BlockReference

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
506 Views, 2 Replies

how to add context menu to the specific BlockReference

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);
        }
2 REPLIES 2
Message 2 of 3
Alexander.Rivilis
in reply to: Anonymous

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

Message 3 of 3
Anonymous
in reply to: Alexander.Rivilis

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

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

Post to forums  

Forma Design Contest


AutoCAD Beta