AutoCAD 2010/2011/2012

AutoCAD 2010/2011/2012

Reply
Valued Contributor
56 Posts
4 Kudos
Registered: ‎12-06-2006
Post 1 of 5

common ribbontab in different partial cui

730 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*
9,836 Posts
1,219 Kudos
Registered: ‎06-29-2007
Post 2 of 5

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
56 Posts
4 Kudos
Registered: ‎12-06-2006
Post 3 of 5

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
56 Posts
4 Kudos
Registered: ‎12-06-2006
Post 4 of 5

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
56 Posts
4 Kudos
Registered: ‎12-06-2006
Post 5 of 5

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 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!