Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Programming in Revit

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
1781 Views, 4 Replies

Programming in Revit

Dear all,

I have to do some programming in revit. I am just beginner so i dont have much idea
about how i know a little bit of Vb.net. I know i have installed .net in my system
and downloaded and installed revit2011sdk0.exe after extrating i get Revit 2011 SDK in my desktop. I tried to run the sample application from the folder Revit 2011 SDK but it gives me an error " Type or namespace AutoDesk is not found (are you missing a using Directive or an assemble reference?)
Please help me get started on programming


Thanks
Rinu
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

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

Message 3 of 5
Anonymous
in reply to: Anonymous

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.

Message 4 of 5
Anonymous
in reply to: Anonymous

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)]

Message 5 of 5
Anonymous
in reply to: Anonymous

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.

Post to forums  

Rail Community


Autodesk Design & Make Report