1

I used the Revit Add-In Template but when I run the application I get this error. Do you know why I am getting this error? the error I get is Revit cannot run ExternalApplication. do you know why it cannot run the External Application?

The Error Message

External Tools- External Tool Failure = Revit Cannot run External application "Application NewRibbon01"

1 Answers1

1

This message indicates that you have installed an add-in manifest *.addin file in the Revit AddIns folder that refers to an external application NewRibbon01 that cannot be loaded for some reason.

One possible reason is that it cannot be found.

For instance, the add-in .NET DLL assembly file may not be located in the same AddIns folder, or an invalid path to the add-in DLL may have been specified.

Please read and follow the basic information about Revit add-in integration in the Revit developers guide. It explains in full how to set up your add-in manifest correctly.

The previous link refers to the Revit 2022 developer guide. The same information applies to Revit 2020 as well: Revit 2020 add-in integration

The easiest way to get to grips with the fundamentals of Revit add-in installation, framework architecture and more advanced usage is to work through the Revit API getting started material. That will answer this question of yours in full and innumerable others as well.

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17
  • Thank you Jeremy, Last night I ended up starting over using the 2019 template and it worked because it was generating the .dll file that the 202o addinn template wasn't creating. I just need to remember to check and make sure when using the templates and I hit the Build feature, that it generates a dll file. is there a way to just add a .dll file to existing project if there is not one being created? like the problem I was having yesterday, I noticed that the project folder had no .dll file. that would be good if we could add one similar to the way we add a Class file. – Rick Holguin Jul 10 '21 at 18:50
  • another question I had was for the command, my ribbon button has been added and works fine using your addinn template. but I want my command to open and external file, like a hyperlink to an excel file. can this be done? – Rick Holguin Jul 10 '21 at 18:52
  • To open a file in .NET, you can use the File.Open method: https://learn.microsoft.com/en-us/dotnet/api/system.io.file.open?view=net-5.0 – Jeremy Tammik Jul 11 '21 at 22:25
  • I sent you the file in an email, because its to hard to explain. – Rick Holguin Jul 12 '21 at 02:30
  • I think an explanation is required. No question, no answer. – Jeremy Tammik Jul 12 '21 at 08:01
  • my new error is: Revit cannot run the external application "Application NewRibbon02". Contact the provider for assistance. Information they provided to Revit about their identity: James Simpson, https://bimsquared.com. – Rick Holguin Jul 12 '21 at 16:50
  • Show Details: System.TypeLoadException- "Could not load type 'NewRibbon02.Command' from assembly 'NewRibbon02, Version=2019.1.0.0, Culture=neutral, PublicKey Token=null'. – Rick Holguin Jul 12 '21 at 16:54
  • maybe if I change the Version to 2021.1.0.0? because that's the version I am using? let me know, thanks – Rick Holguin Jul 12 '21 at 16:55
  • Okay, I worked out that error. but I want to replace my Trans,Try, return method to open a form1, I created. – Rick Holguin Jul 12 '21 at 19:34
  • using (Transaction Trans = new Transaction(doc)) { //starts the transcation Trans.Start("Temp Trans"); { – Rick Holguin Jul 12 '21 at 19:35
  • Reference eref = uidoc.Selection.PickObject(ObjectType.Element, "Select an object"); //create a quick prompt TaskDialog ts = new TaskDialog("Test Dialogue"); //tell it to show the selected elements name ts.MainContent = doc.GetElement(eref).Name; //display the dialog ts.Show(); //commit the changes Trans.Commit(); //return success return Result.Succeeded; – Rick Holguin Jul 12 '21 at 19:36
  • I changed to this: // This sample assumes that you have a folder named "c:\temp" on your computer. string filePath = @"K:\\Support\00_DETAIL LIBRARY\CSI_Masterformat\masterformat-2016.pdf"; // Delete the file if it exists. if (File.Exists(filePath)) { File.Delete(filePath); } // Create the file. using (FileStream fs = File.Create(filePath)) Byte[] info = new UTF8Encoding(true).GetBytes("This is some text in the file."); // Add some information to the file. fs.Write(info, 0, info.Length); – Rick Holguin Jul 12 '21 at 19:44
  • I have a Command.cs, but when I run the Build command it ha these 3 errors that I cannot get rid of. CS0161 which is my line 21 = public Result Execute( CS1513 } expected which is line 56 at the very end of my code = } – Rick Holguin Jul 15 '21 at 21:50
  • not all code paths return a value -- read all about it here and elsewhere: https://stackoverflow.com/questions/21197410/c-sharp-compiler-error-not-all-code-paths-return-a-value – Jeremy Tammik Jul 18 '21 at 07:17
  • Jeremy, I tried this but it has one error. how can I fix it? Severity Code Description Project File Line Suppression State Error CS1729 'Form1' does not contain a constructor that takes 1 arguments NewRibbon02 – Rick Holguin Jul 20 '21 at 17:53
  • Example of my Code: namespace NewRibbon02.Command { [Transaction(TransactionMode.Manual)] public class Command : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { Form1 wf = new Form1(commandData); wf.ShowDialog(); wf.Close(); return Result.Succeeded; } } } – Rick Holguin Jul 20 '21 at 17:53