New Member
1 Posts
0 Kudos
Registered: ‎01-20-2013
Post 1 of 3

How to add a toolbar using cui

335 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
762 Posts
100 Kudos
Registered: ‎03-21-2011
Post 2 of 3

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

1,465 Posts
277 Kudos
Registered: ‎04-09-2008
Post 3 of 3

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
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!