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); }
Solved! Go to Solution.
Solved by Alexander.Rivilis. Go to 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
Can't find what you're looking for? Ask the community or share your knowledge.