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: 

Check out the self-paced guide “My First Plug-in”

81 REPLIES 81
Reply
Message 1 of 82
saikat
17210 Views, 81 Replies

Check out the self-paced guide “My First Plug-in”

Check out the Self-Paced Guide “My First Plug-in” presented by the ADN Revit Team

http://www.autodesk.com/myfirstrevitplugin

 

Note on 5/11/2018:  My First Plug-in is being migrated to Knowledge Base (similar to this forum). Right now, the marketing URL is not working. In a mean time, you can access here:  
https://knowledge.autodesk.com/community/collection/my-first-autodesk-revit-plug

Still work in progress. Working on updating all the links, to the latest three releases, etc. 

 

Are you an Autodesk Revit power user with an interest in becoming even more productive? Would you like to automate or extend the capabilities of Revit, but are new to computer programming? If so, then this guide is designed for you.

 

“My First Plug-in” is a self-paced tutorial guide for a smooth introduction into the programming world. This is a “one-stop shop” learning path for users who know Autodesk products but are absolutely new to programming and are thinking about taking the plunge. In this guide, you will be working with the Autodesk Revit .NET API and the C# programming language. The supported product version is Autodesk Revit Architecture 2011 and succeeding versions.

 

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 programming. 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.

 

Product: Autodesk Revit 2011 or higher
Programming Language: C#
Application Programming Interface (API): Revit .NET API

If you have any feedback on this new guide let us know at myfirstplugin@autodesk.com

 



Saikat Bhattacharya
Senior Manager - Technology Consulting
Tags (2)
81 REPLIES 81
Message 41 of 82
kimmansu81
in reply to: b_ralphs

Thanks it help.
I am using Revit2015. it still work with this
Element elem = doc.GetElement(pickedRef);
Message 42 of 82
m.touchard
in reply to: saikat

The Link is dead,

Long live the Link!

Message 43 of 82
mikako_harada
in reply to: m.touchard

Hi m.touchard, 

 

Which link are you having a problem?  I just tried with this (which is the topic of this post), it works for me now.  

 

http://www.autodesk.com/myfirstrevitplugin

 

Maybe there was a temporary problem with the internet or a server.  Sometimes the browser may have a problem.  I sometimes find refreshing the browser solves a problem.  


Mikako Harada
Developer Technical Services
Message 44 of 82
m.touchard
in reply to: mikako_harada

Hey ! 
After checking again it seems the problem come from Google Chrome which display :

The Page You Requested Was Not Found

 

The link works very well with Edge even if the redirect URL is the same. 

Thanks for the reply!

Message 45 of 82

Hi Mikako,

Just to let you know that the link to 'Message Listing' at the base and top of this page incorrectly point to http://forums.autodesk.com/t5/revit-api-forum/bd-p/160/page/11 (in IE11).

 

Cheers,

 

Matt


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
Message 46 of 82

Hi Matt,

 

Just tested with IE11. (Mine says Version: 11.0.9600.17843IS).  Both brings to:

 

http://forums.autodesk.com/t5/revit-api-forum/bd-p/160

 

which is correct. Tooltip when you hover on the link also shows the same one. 

 

Maybe it was temporary or somebody else reported and fixed.

 

Thank you for quickly reporting when you noticed, though.


Mikako Harada
Developer Technical Services
Message 47 of 82

Thanks Mikako.
Mine appears absolutely as you say now.

Have a nice weekened.

-Matt

Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
Message 48 of 82
zachzwy
in reply to: saikat

I am stuck on adding reference to Visual Studio. Here is the error message after I try to add RevitAPIUI as reference.

 

Bug.PNG

 

I couldn't find any answers. Could anyone help me?

 

Thanks.

 

Message 49 of 82
gmayEngineer
in reply to: zachzwy

Did you choose the "Class Library (.NET Framework)" when you create your project ?

Besides in the "Build" properties, make sure you have chosen a compatible framework  with Revit (I think the Framework 4.5.2 is ok)

 

 

Kind Regards,

 

GM

Message 50 of 82
zachzwy
in reply to: gmayEngineer

Thanks!

 

I got this problem now.

 

Bug.PNG

Message 51 of 82
zachzwy
in reply to: zachzwy
Message 52 of 82
gmayEngineer
in reply to: zachzwy

Hi @zachzwy,

 

Did you add the following references :

 

-RevitAPI.dll

 

-RevitAPIUI.dll

 

It seems that a reference is missing.

I've tried with these references and it worked for me.

 

If you still have issues, please provide more information.

 

Cheers,

 

GM

Message 53 of 82
zachzwy
in reply to: gmayEngineer

  

Message 54 of 82
gmayEngineer
in reply to: zachzwy

Hi @zachzwy

 

About what I see in your screenshot it seems that it's working : You've put a PickObject in your code whose description is "Please select a group" and I see in the bottom left corner that description"Please select a group". So I assume that your code went through there. I want you to know that the PickObject method don't display a window to the user but only that message in the corner. So for me everything seems good.

 

Cheers,

 

GM

Message 55 of 82
zachzwy
in reply to: gmayEngineer

Hi @gmayEngineer

 

You are right. The plug-in works well. My problem is that the debugging doesn't work well. When I hit start debugging, the toggled line is supposed to turn yellow according to the instruction. But in my situation, it doesn't, which means I could not debug the code line by line.

 

 

2.PNG

http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=20132893

 

Thanks,

Message 56 of 82
gmayEngineer
in reply to: zachzwy

@zachzwy, in the properties of debugging, did you set the configuration to "(Debug) active" ?

If so, I don't know how to fix it sorry...

 

PS : Sorry the attached picture is in french but I'm sure you will understand it cause it's very similar to English

 

Regards,

 

GM

Message 57 of 82
zachzwy
in reply to: gmayEngineer

Hi @gmayEngineer

 

I believe this it the problem. Thank you very much.  But the weird thing is that those options are grey out here.

 

3.PNG

Message 58 of 82
gmayEngineer
in reply to: zachzwy

@zachzwy,

 

Yeah, it seems that it could cause an issue when debugging

I don't know how to fix it especially because you don't have the same version of visual studio I think.

Take a look at this video which explains how to set properly the Visual Studio configuration in order to work with Revit : 

 

https://www.youtube.com/watch?v=C0mNU2bEUSs

 

When I start with Revit API I've done every project thanks to this video.

 

Regards,

 

GM

Message 59 of 82
zachzwy
in reply to: gmayEngineer

@gmayEngineer

 

Thank you so much for your help. I appreciate it!

 

 

Message 60 of 82
Anonymous
in reply to: saikat

Hi, I'm getting problems when typing the codes of placing a new group in each of the selected rooms. The guide shows two methods and both have errors. I'm using Revit 2017 and Visual Studio 2015.

Capture1.PNGCapture2.PNGCapture3.PNGCapture4.PNG

 

 

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