Consume Revit API's directly from Visual Studio 2017 instead of Revit plugins.

Consume Revit API's directly from Visual Studio 2017 instead of Revit plugins.

Anonymous
Not applicable
710 Views
3 Replies
Message 1 of 4

Consume Revit API's directly from Visual Studio 2017 instead of Revit plugins.

Anonymous
Not applicable

Hi,

 

Background: I have created a Revit plugin which is displayed as a button in a menu in Revit software. The click of the button export some data of a Revit file in the data base. For using this data export service I need to click on the Revit plugin i.e. button.

 

Requirements: I want to reuse the code written in Revit plugin by calling the Revit API's directly from the code without running Revit software. Which means I want to call Revit API's directly from my code and perform the export functionality from a web application without opening Revit software or pressing any button within the menu's of Revit software.

 

Please tell me how to achieve this functionality.

711 Views
3 Replies
Replies (3)
Message 2 of 4

cwaluga
Advocate
Advocate

The only way to use the API outside of a running instance of Revit is Forge (new Revit design automation API).

Message 3 of 4

Anonymous
Not applicable

There are many resources available on the web for you to learn about the Autodesk Revit API (Application Programming Interface), however, these resources tend to be designed for people who already know to program. This guide is different: it assumes no previous programming knowledge and yet helps you build your first plug-in quickly, without swamping you with details. You’ll have a working application within an hour of starting this material, irrespective of your current level of programming expertise.

 

The guide will start by reviewing the benefits of customizing Autodesk software before progressing onto lessons covering the use of the Autodesk Revit API. The lessons will start by building a working plug-in before covering more detailed explanations of the underlying principles and further developing the application’s functionality.

 

Autodesk Revit has a .NET API which means you can use any of the .NET compliant programming languages (C#, VB.NET, F#, etc.) to develop a plug-in. While each language has its own relative benefits, C# is the natural choice for this guide: it is easy-to-learn, easy-to-use, and leverages the power of the underlying .NET Framework. As you become comfortable with the content of this guide - and more proficient with C# - you’ll be able to move on to solving more complex problems with the language.

 

Despite C# being a natural choice, sometimes there are limitations outside your control of what languages you can work with within your company. The programming language VB.NET takes a very close second place to C#, so to accommodate readers looking to work with VB.NET in Autodesk Revit; we have provided you all the lesson code in VB.NET.

 

Using other versions of Visual Studio that support C# is also possible. Supported .NET versions for each Revit version are as follows: Note: at the time of this writing, the latest in Visual Studio Community 2019.

 

If you are using languages like Python, JavaScript, or PHP then use Visual Studio Code as a code editor.

 

Programming can be very rewarding. We hope you feel that way too after completing these lessons. Have fun!

 

I hope this helps.

 

Best regards,

Message 4 of 4

joshua.lumley
Advocate
Advocate

Krunal that is the most comprehensive and complete answer to a forum question I've read for some time. Your a giver (-: