Message 1 of 9
External Command Initialization issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have completed the Revit API tutorials and written a number of example classes with general success.
However I am having a strange issue that I cannot seem to resolve.
I created a code snippet of the External Command instantiation rather than type all that into each class. But when I use the snippet VS is erroring out on the IExternalcommand.Execute statement. Now if I type that into a new class it works fine but copy/paste or Snippet generates an error and the class will not debug or build properly. Delete the text and type it verbatim it works.
The error is
"Must declare a body because its not marked abstract, extern or partial"
Here is how I am declaring it:
[TransactionAttribute(TransactionMode.Manual)]
public class DeleteElement : IExternalCommand
{
Result IExternalCommand.Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
Result IExternalCommand.Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
Again this works fine when I type it even using suggestion to fill in, but past or snippet does not work.