When building Revit addins, you may want to implement some specific selection filter. Here is some more good stuff via Alexander Buschmann and The Building Coder:
The zip file SelFilters.zip contains

  • the SelFilter class, 
  • the interface files, an 
  • example external command
    using some of the SelFilter functionality, an 
  • add-in manifest file for
    the example command and a 
  • small Revit project to test it in.

Source:
The Building Coder: SelFilter, a Powerful Generic Selection Filter Utility

To try it out:

  1. In Visual Studio (I use Express 2013 for Windows Desktop), make a new Class Library Project
  2. File – Save project as – RevitSelectionFilters.csproj
  3. Add RevitAPI.dll and RevitAPIUI.dll references (2014)
  4. Add – Existing Items. Choose all the .cs files from the zip
  5. Set project properties Assembly Name and Default namespace to RevitSelectionFilters
  6. Save All
  7. Build Solution
  8. Copy
    SelectionTest.addin and RevitSelectionFilters.dll
    to C:ProgramDataAutodeskRevitAddins2014

Related screenshots:

And screencast showing the examples:

Good intro to Revit customization:
http://help.autodesk.com.s3.amazonaws.com/sfdcarticles/kA230000000tiXXCAY/handout_2116_CM2116.pdf

From the help:
Help: External Commands

Setting up an External Command in Revit 2015:
EXTERNAL COMMAND IN 10 STEPS FOR REVIT 2015 API 

Most of you already know how highly I recommend Harry Mattison.  He is completely at peace with the Revit API, and he knows instinctively how to solve Revit coding challenges that are out of reach for most of us.

For less than $150, you can learn the Revit API from the master, at https://www.udemy.com/revitapi/

Harry was an employee of Revit Technology Corporation and Autodesk from 1998 to 2012 and spent four of those years developing and testing new Revit APIs in areas such as the Family Editor, Massing, Analysis Visualization, Dynamic Model Update, and Views & Schedules.

I have personally started reviewing the classes, and the level of expertise targeted by this course is very appropriate — intermediate to advanced Revit users, with a comprehension of basic programming techniques.  Not too basic, and not too complicated 🙂

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.

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

via
Autodesk – My First Plug-in Training – My First Revit Plug-in Overview