AutoCAD 2010/2011/2012

AutoCAD 2010/2011/2012

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

common ribbontab in different partial cui

355 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,071
Registered: ‎06-29-2007
Message 2 of 5 (352 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 (350 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 (330 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 (326 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;
        }

 

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.