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

How to add a toolbar using cui

2 REPLIES 2
Reply
Message 1 of 3
yingzi_tj
592 Views, 2 Replies

How to add a toolbar using cui

there is a problem with my code,when I load this dll,the toolbar‘s name can be fond in the customization dialog,but never shows in the UI(AutoCAD custom WS)。。。。It crush me up。。

       

[CommandMethod("AddToolBar")]
        public void AddToolBar()
        {
            CustomizationSection cs = new CustomizationSection(
                "C:\\Users\\Administrator\\appdata\\roaming\\autodesk\\autocad 2012 - simplified chinese\\r18.2\\chs\\support\\acad.cuix");
            CAD.Document doc = CAD.Application.DocumentManager.MdiActiveDocument;
            Toolbar newTb = new Toolbar("MyTool", cs.MenuGroup);
            newTb.ToolbarVisible = ToolbarVisible.show;

            foreach (Workspace wk in cs.Workspaces)
            {
                WorkspaceToolbar wkTb = new WorkspaceToolbar(wk, newTb);
                wk.WorkspaceToolbars.Add(wkTb);
                wkTb.Display = 1;
                         
            }
            cs.Save();
        }

 

QQ截图20130120191515.png

 

i dont no y.........need help························

 

i am a chinese,know little english.so it is hard for me to find codes of this aspect at this website,can u get me the link of the code?

thanks。谢谢

 

2 REPLIES 2
Message 2 of 3
Balaji_Ram
in reply to: yingzi_tj

Hello,

 

Your code look ok to me.

 

Does the toolbar appear after switching workspaces manually in AutoCAD ?

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 3 of 3

I do not see that this cui-file was loaded into AutoCAD (with command _CUILOAD). Also there is no any toolbar control created in your's code.

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

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost