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

How to add a toolbar using cui

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


        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);
                wkTb.Display = 1;




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?



ADN Support Specialist
Posts: 749
Registered: ‎03-21-2011
Message 2 of 3 (281 Views)

Re: How to add a toolbar using cui

01-24-2013 10:48 AM in reply to: yingzi_tj



Your code look ok to me.


Does the toolbar appear after switching workspaces manually in AutoCAD ?



Developer Technical Services
Autodesk Developer Network

Posts: 1,458
Registered: ‎04-09-2008
Message 3 of 3 (276 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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.