.NET

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

How to add a toolbar using cui

321 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: 733
Registered: ‎03-21-2011
Message 2 of 3 (271 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,446
Registered: ‎04-09-2008
Message 3 of 3 (266 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
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!