Solved! Go to Solution.
hi all
I have mannaged so far to get
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.Revit;
namespace ClassLibrary1
{
public class Class1 : IExternalCommand
{
}
}
But it gives me an error IExternalCommand "Type or namespace AutoDesk is not found (are you missing a using Directive or an assemble reference?)"
I have added the reference RevitApi.dll
but still its giving me this error
Please Help
hi all
i have managed so far and i am getting one error while i try to run in revit
i have added revit.ini with the following
[ExternalCommands]
ECCount=1
ECName1=MY Hello World
ECClassName1=RevitDevTV.Class1
ECAssembly1=C:\Documents and Settings\6025\Desktop\revit prog\My Revit application\RevitDevTV\RevitDevTV\bin\Debug\RevitDevTV.dll
ECDescription1= My hellow to revit
but when i click on the addin it gives me an error
Could not run the add-in "hellow world" because it does not have regestration attributed assigned.
Please contact the provider of the add in with the following information.
the regestration attributes specifies the actions taken by revit when the add-in modifies the data via
the revit api. This attribut must be applied to the class implementing IExternalCommand or IExternalApplication. In the application sourcecode to allow the revitto successfully run the addin
Please reffer the documentation of regestration attribute.
I found the Problem in 2011 we need to use
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
The problem is that IExternalCommand's fully qualified name is Autodesk.Revit.UI.IExternalCommand. you have only imported Autodesk.Revit.
you can do one of two things: 1.) drop in the line 'using Autodesk.Revit.UI' along with the other using directives, or 2.) prefix all instances of 'IExternalCommand' with a 'UI.' making it 'UI.IExternalCommand. note that you will need to reference RevitAPIUI.dll (found in the same directory as RevitAPI.dll) in the project.
also, you have not fulfilled the interface. by implementing an interface, you must implement ALL functions defined in the interface. in IExternalCommand's case, the only function which needs to be implemented is Execute. you will get errors until it is implemented.
hope the clears things up. also go through the API Developer's Guide which come with the SDK, its a good resource for these type of questions.
-Best
Can't find what you're looking for? Ask the community or share your knowledge.