Hi all
I am a new to programming in revit but i consider myself a vary experienced revit user,
I am trying to just create a simple HelloWorld addin using C#.net 2010 Express,
I have created the .dll file, and the .addin fill with what i think is the correct refferancing.
When i open RAC start a new project go to the Addin tab and select my HelloWorld addin nothing happens... nothing at all.. no errors or anything.
The only differences i have noticed between my setup the the example under the SDK developers guide is that when i build the solution it says the location was saved in the \bin\release folder and not the \bin\debug folder, when i try and run a debug it comes up with the error that you can not run as a class library.
i am not sure if its a C# 2010 thing or am i missing something.
Your help would be much appreciated.
Cheers
Dave
Problem sorted it was the .NET Framework i had to roll back from 4 to 3.5...
Next problem i have come across is when i try and build a Ribbon Panel..
When i try to run it there is no panel but it comes up in the external tools drop down next to my helloworld addin,
when i select it it pops up with the following message:
The Code i am using is:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Autodesk.Revit.UI; using Autodesk.Revit.DB; using System.Windows.Media.Imaging; namespace AddPanel { [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Automatic)] [Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)] public class CsAddPanel : Autodesk.Revit.UI.IExternalApplication { public Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application) { // add new ribbon panel RibbonPanel ribbonPanel = application.CreateRibbonPanel("NewRibbonPanel"); //Create a push button in the ribbon panel “NewRibbonPanel” //the add-in application “HelloWorld” will be triggered when button is pushed PushButton pushButton = ribbonPanel.AddItem(new PushButtonData("HelloWorld", "HelloWorld", @"C:\Documents and Settings\knowlesd\my documents\visual studio 2010\Projects\HelloWorld\HelloWorld\bin\Release\HelloWorld.dll", "HelloWorld.CsHelloWorld")) as PushButton; // Set the large image shown on button Uri uriImage = new Uri(@"C:\Documents and Settings\knowlesd\my documents\visual studio 2010\Projects\HelloWorld\HelloWorld\bin\Release\39-Globe_32x32.png"); BitmapImage largeImage = new BitmapImage(uriImage); pushButton.LargeImage = largeImage; return Result.Succeeded; } public Result OnShutdown(UIControlledApplication application) { return Result.Succeeded; } } }
any ideas 🙂
Thanks
Hi,
Please change the settings from Release mode to Debug mode to have Debugging enabled.
When you are building the dll, if the outut is going to the Relase folder, you'll not be able to debug the application.
To do the changes Right click on the Solution Explorer >properties >Configration Properties >Change it Debug mode .
In reply to your second issue , Please check if there Hello.dll and is this registered in the add-in (C:\Documents and Settings\knowlesd\my documents\visual studio 2010\Projects\HelloWorld\HelloWorld\bin\Release\HelloWorld.dll), The error is coming because of the Helloworld.dll. Check if this is running independently. If not fix the problem there .
Hi
This code is for the IExternalApplication, but it seems that your .addin is trying to register it as a IExternalCommand.
Can you post your .addin here too? That way we can check it...
Regards,
Augusto Goncalves
Autodesk Developer Network