Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"Unexpected tab" error

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
denisyukJ
389 Views, 3 Replies

"Unexpected tab" error

denisyukJ
Advocate
Advocate

Hi, 

Trying to make a simple tab, but faced with an error. 

denisyukJ_1-1690968581682.png

Here is my code:

 

 

#region Namespaces
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.IO;
using System.Reflection;

#endregion

namespace YYY
{
    internal class App : IExternalApplication
    {
        public Result OnStartup(UIControlledApplication a)
        {
            string tabName = "PERIR";
            string panelName = "Info";

            a.CreateRibbonPanel(tabName);

            var panel = a.CreateRibbonPanel(tabName, panelName);
            
            var button1 = new PushButtonData("Info", "b1", "C:\\Users\\denisyuk\\Desktop\\RevitApiTest\\YYY.dll", "YYY.Command");
            button1.ToolTip = "TT";
            button1.LongDescription = "This is TT";

            var btn1 = panel.AddItem(button1) as PushButton;


            return Result.Succeeded;
        }

        public Result OnShutdown(UIControlledApplication a)
        {
            return Result.Succeeded;
        }
    }
}

 

 

Nothing special just stuck on this.

 

UPD: I set AssemblyName hardcoded because I use virtual michine to make a build and place it as well as addin file to correspondng directories manually.

0 Likes

"Unexpected tab" error

Hi, 

Trying to make a simple tab, but faced with an error. 

denisyukJ_1-1690968581682.png

Here is my code:

 

 

#region Namespaces
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.IO;
using System.Reflection;

#endregion

namespace YYY
{
    internal class App : IExternalApplication
    {
        public Result OnStartup(UIControlledApplication a)
        {
            string tabName = "PERIR";
            string panelName = "Info";

            a.CreateRibbonPanel(tabName);

            var panel = a.CreateRibbonPanel(tabName, panelName);
            
            var button1 = new PushButtonData("Info", "b1", "C:\\Users\\denisyuk\\Desktop\\RevitApiTest\\YYY.dll", "YYY.Command");
            button1.ToolTip = "TT";
            button1.LongDescription = "This is TT";

            var btn1 = panel.AddItem(button1) as PushButton;


            return Result.Succeeded;
        }

        public Result OnShutdown(UIControlledApplication a)
        {
            return Result.Succeeded;
        }
    }
}

 

 

Nothing special just stuck on this.

 

UPD: I set AssemblyName hardcoded because I use virtual michine to make a build and place it as well as addin file to correspondng directories manually.

3 REPLIES 3
Message 2 of 4
Mohamed_Arshad
in reply to: denisyukJ

Mohamed_Arshad
Advisor
Advisor
Accepted solution

HI @denisyukJ 
you're not creating a tab, Twice time you have created panel. Check Line No. 24 and 25.

 

In Ln No.24 change to a.CreateRibbonTab(tabName);

a.CreateRibbonTab(tabName);

 

Hope this will Helps 🙂

Thanks & Regards,
Mohamed Arshad K
0 Likes

HI @denisyukJ 
you're not creating a tab, Twice time you have created panel. Check Line No. 24 and 25.

 

In Ln No.24 change to a.CreateRibbonTab(tabName);

a.CreateRibbonTab(tabName);

 

Hope this will Helps 🙂

Thanks & Regards,
Mohamed Arshad K
Message 3 of 4
jeremy_tammik
in reply to: denisyukJ

jeremy_tammik
Autodesk
Autodesk

You are calling CreateRibbonPanel twice over. Revit probably does not like that.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open

You are calling CreateRibbonPanel twice over. Revit probably does not like that.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 4 of 4
denisyukJ
in reply to: denisyukJ

denisyukJ
Advocate
Advocate

Sorry for my inattention. Shame on me. 😣

0 Likes

Sorry for my inattention. Shame on me. 😣

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report