• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD 2010/2011/2012 DWG Format

    Reply
    Valued Contributor
    Posts: 54
    Registered: ‎12-06-2006

    common ribbontab in different partial cui

    188 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

    Please use plain text.
    *Expert Elite*
    Posts: 6,475
    Registered: ‎06-29-2007

    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
    -------------------------------------------------------------------------
    Please use plain text.
    Valued Contributor
    Posts: 54
    Registered: ‎12-06-2006

    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

    Please use plain text.
    Valued Contributor
    Posts: 54
    Registered: ‎12-06-2006

    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 ?

    Please use plain text.
    Valued Contributor
    Posts: 54
    Registered: ‎12-06-2006

    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;
            }

     

    Please use plain text.