.NET

Reply
New Member
yingzi_tj
Posts: 1
Registered: ‎01-20-2013
Message 1 of 3 (298 Views)

How to add a toolbar using cui

298 Views, 2 Replies
01-20-2013 03:22 AM

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。谢谢

 

ADN Support Specialist
Balaji_Ram
Posts: 692
Registered: ‎03-21-2011
Message 2 of 3 (248 Views)

Re: How to add a toolbar using cui

01-24-2013 10:48 AM 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

Moderator
Alexander.Rivilis
Posts: 1,406
Registered: ‎04-09-2008
Message 3 of 3 (243 Views)

Re: How to add a toolbar using cui

01-24-2013 01:40 PM in reply to: yingzi_tj

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.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.