A project with an Output Tyoe of Class...

A project with an Output Tyoe of Class...

Johan_Ekstrom
Enthusiast Enthusiast
655 Views
1 Reply
Message 1 of 2

A project with an Output Tyoe of Class...

Johan_Ekstrom
Enthusiast
Enthusiast

Hi

 

I know this question has been up before, but I suppose I'm too much of a rookie with programming to fully understand the answers provided in different forums and blogs. 

 

I updated a code to 2017 and it buids without errors, but i get this message:

 

Skärmklipp.PNG

 

I understand that a Class can't be run as startup, but it has worked in 2014-16. Whats the difference?

I tried to choose the project as Set as startup Project but it doesn't help. When i right-click it and assign it, the properties is still empty:

 

2.png

 

I've checked the box Use Managed Compatibility Mode. 

 

This is the beginning of the code, if it helps. 

 

namespace BSK_Tools
{
    [TransactionAttribute(TransactionMode.Manual)]
    public class BSK_ToolsRibbon : IExternalApplication
    {
        static string AddInPath = typeof(BSK_ToolsRibbon).Assembly.Location;
        static string ButtonIconsFolder = Path.GetDirectoryName(AddInPath);
        string assembly = @"\\stofile01\filestorage\Liljestrand Fastigheter\Dokument\LFAB_tools\BSK_Tools.dll";

        public Result OnStartup(UIControlledApplication a)
        {
            a.CreateRibbonTab("LFAB");

            //Paneler
            RibbonPanel BSKPanela = a.CreateRibbonPanel("LFAB", "View");
            RibbonPanel BSKPanela2 = a.CreateRibbonPanel("LFAB", "Annotation");
            RibbonPanel BSKPanelM = a.CreateRibbonPanel("LFAB", "Manage");
            RibbonPanel BSKPanelb = a.CreateRibbonPanel("LFAB", "Standards");
            
            //Panel a buttons
            PushButtonData pushButtona1 = new PushButtonData("Remove\nUnderlay", "Remove\nUnderlay", AddInPath, "BSK_Tools.Remove_Underlay");
            pushButtona1.LargeImage = new BitmapImage(new Uri(@"\\stofile01\filestorage\Liljestrand Fastigheter\Dokument\LFAB_tools\Underlay1.png"));
            pushButtona1.ToolTip = "Sätter parametern Underlay i alla vyer till None";

Even if i run it with the manifest i Revit I get the ribbon with panels but no buttons. Is there something in between there...?

 

Thankful for every tip...



------------------------------------
Type x and y with every move in AutoCad and no one bats an eye...but use coordinates in Revit and everybody loses their mind.
0 Likes
656 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk

Kära Johan,

 

In the Visual Studio project properties, you need to set up the external executable to launch, and it has to be Revit.exe, with its full path specified.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes