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: 

Looking for C++ Samples for Revit 2017 AddIn

6 REPLIES 6
Reply
Message 1 of 7
epogue
2175 Views, 6 Replies

Looking for C++ Samples for Revit 2017 AddIn

As I look through the Revit 2017 documentation it looks like C++ has become nearly a first class citizen. I am mostly familiar with starting AddIn Revit AddIn projects using the AddIn Wizard for C#. Is there something comparable for C++? And/or is there sample code or a tutorial on implementing a Revit 2017 AddIn using C++ instead of C# or VB? 

6 REPLIES 6
Message 2 of 7
R.van.den.Bor
in reply to: epogue

I don't think that there are c++ samples. Found this post though:

http://thebuildingcoder.typepad.com/blog/2010/10/c-revit-add-in.html

 

Kind regards,
Remy van den Bor
ICN Solutions B.V.
Liked this post or found it usefull, don't forget the Kudo It won't hurt (at least not me).
Message 3 of 7
jeremytammik
in reply to: epogue

This thread is a duplicate of 

 

http://forums.autodesk.com/t5/revit-api-forum/looks-for-c-samples-for-revit-2017-addin/m-p/6744702

 

C++ has always been a first-class citizen in the .NET world, just like any other language supporting .NET, which was added to C++ with the introduction of managed C++ over a decade ago.

 

The Visual Studio C# and VB .NET wizards are very easy to create from scratch, and so is a C++ Revit add-in and a wizard for it.

 

  • Use the standard Visual Studio class wizard to create a class.
  • Add references to the Revit API assemblies.
  • Implement an external command or external application.
  • Done.

 

The files that you create manually through these steps can be packaged into a ZIP file and reused to create a Revit C++ add-in wizard.

 

Look at the descriptions of creating, modifying and updating the C# and VB wizards to see how the same can be achieved for C++:

 

 

Here is an old description of a C++ Revit add-in and some other discussions on related topics::

 

 

I wish you lots of fun and success making use of C++ with the Revit API!

 

Please let us know how it goes and what you find out.

 

Thank you!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 4 of 7
epogue
in reply to: jeremytammik

Thank you! I like the Visual C++ Revit Add-In step-by-step article. Regrettably the Visual Studio 2015 "New Project" function no longer includes "Class Library" as one of its options (screen shot provided below). Any thoughts on the alternative "New Project" template to utilize to initially create C++ based Revit Add-In in Visual Studio 15 for Revit 2017? Or if is a recommendation on which version of the .NET Framework to select?

Message 5 of 7
R.van.den.Bor
in reply to: epogue

Can't help you with the template, but the .NET framework I can, that should be 4.5 or higher, since Reivt 2017 needs 4.5 or higher.

Kind regards,
Remy van den Bor
ICN Solutions B.V.
Liked this post or found it usefull, don't forget the Kudo It won't hurt (at least not me).
Message 6 of 7
jeremytammik
in reply to: epogue

Visual Studio > File > New > Project > Templates > Other Languages > Visual C++ > CLR > Class Library.

 

Add references to the Revit API assemblies.

 

Implement your external application or command.

 

The Revit 2017 API requires version the .NET framework version 4.5.2.



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 7 of 7
jeremytammik
in reply to: jeremytammik

I summarised, cleaned up and published this Q&A on the blog:

 

http://thebuildingcoder.typepad.com/blog/2016/12/viewport-bring-to-front-and-c-revit-add-in.html#4

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community