Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anybody give quick insight on why this isn't recognizing? Followed all the steps but won't recognize "Execute".
Solved! Go to Solution.
Can anybody give quick insight on why this isn't recognizing? Followed all the steps but won't recognize "Execute".
Solved! Go to Solution.
Hi Nathan, welcome to the Revit API, your life will never be the same.
If you hover over the error and rest the mouse, Intellisense will pop up an error description.
There's also an "Error List" tab on the bottom pane that will give you more info about the error. Post those and we can be of more help.
My guess is that you are not returning a value. Make sure all code "paths" return Result.Succeeded or Result.Failed.
Thanks Kevin. I posted the snippets below.
I was right! "Not all code paths return a value"
The class "Execute" is expecting a "Result" to be returned. You need to have a "return Result.Succeeded" statement at the end of the Execute code.
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
//do whatver the code does
return Result.Succeeded;
}
Thanks. You just saved me a ton of time trying to do more research. Everything I found online kept saying I was missing a reference.
That was my first inclination as well, but you would have had a lot more errors if you were missing a reference.