FireRating in the Cloud and RevitLookup Update

I am currently working intensely at the Autodesk Cloud Accelerator in Prague.

It is exciting and we are making good progress.

I spent a lot of my time so far enhancing the FireRating in the Cloud sample and documenting these improvements.

Here are my topics for today:

I glad to report that I found Mlsná Kavka (Picky Jackdaw in English), a nice and friendly non-smoking vegetarian restaurant, just around the corner from the Autodesk office:

View from Mlsná Kavka

FireRating in the Cloud Enhancements

My real goal is to switch back and continue work on the new CompHound component tracker as fast as possible, in preparation for the upcoming conference presentations at RTC Europe in Budapest end of October and Autodesk University in Las Vegas in December.

However, since the FireRating in the Cloud sample is more generic and fundamental, I want to clean it up to utter perfection first, before expanding into new areas.

FireRating in the Cloud covers the connection of Revit database and element data to a cloud-hosted external database.

The CompHound component tracker will add a user interface, reports, and a 3D model viewer and navigator to that.

Here is a list of the recent firerating enhancements:

RevitLookup Update to Handle Null Analytical Model

In between other things here a user reported a problem with RevitLookup, saying that, "I loaded and ran RevitLookup 2016 'Snoop Current Selection...' today and encountered a rather spectacular error crashing Revit without an error message when a Generic Floor was preselected."

The error can be solved by commenting out the line accessing the analytical model in the Stream method handling a floor element:

  data.Add( new Snoop.Data.String( "Structural usage",
    floor.GetAnalyticalModel().GetAnalyzeAs().ToString() ) );

In Revit Architecture or MEP, the GetAnalyticalModel will return null, causing the call to ToString to fail.

This was actually fixed – more elegantly, I'm glad to say – in RevitLookup release 2016.0.0.10, so please do make sure to download and install the latest version if you encounter this situation.

I actually already mentioned this two weeks ago...

Retrieving All Model Elements

Once again, let's revisit the topic of selecting model elements, raised this time by Dale in the Revit API discussion thread on traversing all model elements:

Question: To be clear, "all model elements" could be defined as all objects that exist in the real world: chairs, doors, walls, etc. – component and system families. Graphic elements such as levels, sheets, views, dimensions, annotation, profiles, etc. would not be included. I have been through all The Building Coder samples (and others) many times, and whilst there are lots of examples to filter for a specific category or feature, I have been unable to come up with a solution that provides all model elements as defined above. Your example from 2009 (2) may be the best, but given that it is several years old, I have been looking for more contemporary code. Apologies if I am overlooking something obvious; I thought this would be a five-minute job but I have been unable to come up with a simple, solid solution.

Answer: Does this fit the bill?

  IEnumerable<Element> GetAllModelElements(
    Document doc )
    Options opt = new Options();
    return new FilteredElementCollector( doc )
      .Where<Element>( e
        => null != e.Category
        && null != e.get_Geometry( opt ) );

I added and published this in The Building Coder samples release 2016.0.120.14.

Please try it out, and let's ensure that we really get something up and running that suits your needs.

Response: If I ever get to AU again, I owe you a beer! Two maybe. Works perfectly. Thanks again, I hope this is helpful for others as I really struggled to resolve it. Dale