Filtering Samples and RAC 2016 Features

The issue of simple filtered element collector samples was raised in a private message.

I do not like to receive private messages and avoid answering them in private.

I always prefer to discuss everything I do in public and enable the entire community to contribute and share when possible.

In this case, such a message led to the discussion below.

I'll also point to an overview of Revit Architecture 2016 Features.

Simple Filtered Element Collector Samples

Question: I am trying to write C# code to use the Revit API.

The nice samples in the SDK are rather complex :-)

A simple thing I think would be a help for many is some simple samples, e.g.:

  // Floors, Walls, Ceilings, Roofs etc...
  FilteredElementCollector FMFloorCollector
    = new FilteredElementCollector( doc );
 
  FMFloorCollector.OfClass( typeof( Floor ) );
 
  foreach( Floor FMFloor in FMFloorCollector )
  {
    // Type
    Element el = FMFloor as Element;
    ElementId typeid = el.GetTypeId();
    Element floortype = doc.GetElement( typeid );
 
    Parameter pKeynote = floortype.get_Parameter(
      BuiltInParameter.KEYNOTE_PARAM );
 
    // Instance
    Parameter pArea = FMFloor.get_Parameter(
      BuiltInParameter.HOST_AREA_COMPUTED );
  }

What people want to do with the data forms and so on is more or less standard C#.

But simply how to set/get could be nice...

Answer: Have you looked at The Building Coder samples?

Especially, the CmdCollectorPerformance module provides a large number of such samples and probably covers all of the examples you list.

Please let me know if anything is missing.

Or, better still, fork the repository, add them yourself, and let me know so I can merge your update back in again.

Thank you!

Revit Architecture 2016 Features

Nick Bowley and Carl Storms published a nice overview and video recordings of several Revit Architecture 2016 Features: