Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.

Revit API Forum

Reply
Highlighted
Post 1 of 7

Looking for C++ Samples for Revit 2017 AddIn

144 Views, 6 Replies
12-12-2016 03:23 PM

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? 

Post 2 of 7

Re: Looking for C++ Samples for Revit 2017 AddIn

12-12-2016 11:11 PM 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).
Post 3 of 7

Re: Looking for C++ Samples for Revit 2017 AddIn

12-12-2016 11:45 PM 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

Post 4 of 7

Re: Looking for C++ Samples for Revit 2017 AddIn

12-13-2016 08:13 AM 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?

Post 5 of 7

Re: Looking for C++ Samples for Revit 2017 AddIn

12-13-2016 10:35 PM 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).
Post 6 of 7

Re: Looking for C++ Samples for Revit 2017 AddIn

12-13-2016 11:32 PM 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

Post 7 of 7

Re: Looking for C++ Samples for Revit 2017 AddIn

12-15-2016 06:23 AM 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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post

Revit Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Revit helps you achieve greater speed, accuracy, and automation from concept to manufacturing.