AutoCAD 2010/2011/2012

AutoCAD 2010/2011/2012

Reply
Valued Contributor
mario.rosenbohm
Posts: 56
Registered: ‎12-06-2006
Message 1 of 5 (617 Views)

common ribbontab in different partial cui

617 Views, 4 Replies
04-11-2012 05:10 AM

Hello,

 

is this this possible?

 

I have a lot of tools with separate installers. But the ribbon-panales merge in one ribbon-tab.

 

regards

 

Mario

*Expert Elite*
Alfred.NESWADBA
Posts: 9,400
Registered: ‎06-29-2007
Message 2 of 5 (614 Views)

Re: common ribbontab in different partial cui

04-11-2012 05:16 AM in reply to: mario.rosenbohm

Hi,

 

you got a lot of tools? ... from different vendors or from one vendor?

or you have some tools to distribute and need a solution for how such an installer should work?

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Valued Contributor
mario.rosenbohm
Posts: 56
Registered: ‎12-06-2006
Message 3 of 5 (612 Views)

Re: common ribbontab in different partial cui

04-11-2012 05:59 AM in reply to: Alfred.NESWADBA

Hello alfred,

 

its round 6 tools with her own cui and installer.

Regardless of the panels will be installed all in the same tab.

 

 

regards

 

mario

Valued Contributor
mario.rosenbohm
Posts: 56
Registered: ‎12-06-2006
Message 4 of 5 (592 Views)

Re: common ribbontab in different partial cui

04-11-2012 07:13 PM in reply to: mario.rosenbohm

it works, if you create a ribbon tab manually with the equal alias in the main-cuix.

 

Now...  How can i create a ribbon tab in the main-cuix with .net ?

Valued Contributor
mario.rosenbohm
Posts: 56
Registered: ‎12-06-2006
Message 5 of 5 (588 Views)

Re: common ribbontab in different partial cui

04-11-2012 08:41 PM in reply to: mario.rosenbohm

here ist the "main-ribbontab-solution" in c#

        public static Boolean createMainRibbonTab(String tabName, String tabTitle, String tabId, IList<String> workspaces)
        {
            Boolean result = false;
            String mainCuixName = Application.GetSystemVariable("MENUNAME") + ".cuix";
            Autodesk.AutoCAD.Customization.CustomizationSection maincuix = new Autodesk.AutoCAD.Customization.CustomizationSection(mainCuixName, false);
            Autodesk.AutoCAD.Customization.RibbonRoot acRibbonRoot = maincuix.MenuGroup.RibbonRoot;

            Autodesk.AutoCAD.Customization.RibbonTabSource acRibbonTabSource = acRibbonRoot.FindTabWithAlias(tabName.ToUpper());

            if (acRibbonTabSource == null)
            {
                try
                {
                    acRibbonTabSource = new Autodesk.AutoCAD.Customization.RibbonTabSource(acRibbonRoot);
                    acRibbonTabSource.Name = tabName;
                    acRibbonTabSource.Id = tabId;
                    acRibbonTabSource.Aliases.Add(tabName.ToUpper());
                    acRibbonTabSource.Text = tabTitle;
                    acRibbonRoot.RibbonTabSources.Add(acRibbonTabSource);
                    Autodesk.AutoCAD.Customization.WSRibbonTabSourceReference acRibbonTabSourceReference;
                    if (workspaces == null)
                    {
                        foreach (Autodesk.AutoCAD.Customization.Workspace item in maincuix.Workspaces)
                        {
                            acRibbonTabSourceReference = Autodesk.AutoCAD.Customization.WSRibbonTabSourceReference.Create(acRibbonTabSource);
                            acRibbonTabSourceReference.SetParent(item.WorkspaceRibbonRoot);
                            item.WorkspaceRibbonRoot.WorkspaceTabs.Add(acRibbonTabSourceReference);
                        }
                    }
                    else
                    {
                        foreach (String wsName in workspaces)
                        {
                            Autodesk.AutoCAD.Customization.Workspace acWorkSpace = maincuix.getWorkspace(wsName);
                            if (acWorkSpace != null)
                            {
                                acRibbonTabSourceReference = Autodesk.AutoCAD.Customization.WSRibbonTabSourceReference.Create(acRibbonTabSource);
                                acRibbonTabSourceReference.SetParent(acWorkSpace.WorkspaceRibbonRoot);
                                acWorkSpace.WorkspaceRibbonRoot.WorkspaceTabs.Add(acRibbonTabSourceReference);
                            }
                        }
                    }
                    maincuix.Save();
                    result = true;
                }
                catch
                { }

            }
            else
            {
                result = true;
            }
            return result;
        }

 

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!