Open MEP Connector Warning

I presented a little utility add-in yesterday that determines the maximal flow in HVAC duct connectors and populates a shared parameter with the result.

It received positive feedback, and triggered an additional request for new functionality:

Response: Looks great! This is a huge step forward. The routine runs as expected, and actually uncovered a disconnect in my sample model. I was also then able to run it successfully on other, bigger models with no issues.

One situation where we may improve the functionality might be where duct has an open end. Here are two examples of this:

Open connector
Open connector

In these scenarios, flow calculations are incorrect because the duct is open. In the other instances you will see an endcap in this position. It is best practice in Revit (and life) to close these systems.

Answer: Thank you for testing and confirming that it does the job.

Regarding the loose connectors, I actually implemented a quite serious application for checking those a while back, mainly as one of the early samples demonstrating use of the Idling event in Revit 2011 and 2012:

The modeless loose connector navigator is a complete tool in its own right, though, enabling you to navigate through a modeless list of all unconnected connecters and manipulate the model at the same time, jumping back and forth as you like.

I have not updated it for 2014, though, and actually not even for 2013 :-)

So putting some minimal functionality into the new sample to check for open connectors instead makes good sense.

Each Connector instance provides a property IsConnected that can be used to check whether it is open or not.

It is therefore very easy to use LINQ to determine the number of open connectors, i.e. whose IsConnected property returns false, e.g. like this:

  ConnectorSet connectors
    = GetConnectorManager( e ).Connectors;
 
  int nUnconnected = connectors
    .Cast<Connector>()
    .Count<Connector>( c => !c.IsConnected );
 
  bool hasOpenConnectors = 0 < nUnconnected;
 
  string s = 0 == nUnconnected
    ? string.Empty
    : string.Format( " with {0} open connector{1}",
      nUnconnected, Util.PluralSuffix( nUnconnected ) );

I added that code to the SetMaxFlowOnElement method that I presented yesterday, and added some support for reporting back if any open connectors at all are found in the model.

This leads to an additional clause in the result message displayed at the end stating how many elements have open connectors:

Duct iteration result message

The additional clause is omitted if the number is zero, as it normally should be.

The detailed information on the offending elements is provided by the log in the Visual Studio debug output console window (copy and paste to an editor or view source to see the truncated lines in full):

Duct <630420 Mitered Elbows> has 2 connectors and max flow 22.08.
. . .
Duct <630695 Short Radius> has 2 connectors and max flow 4.58.
Duct <630991 Mitered Elbows> has 2 connectors and max flow 0.
Duct <630992 Mitered Elbows> has 2 connectors and max flow 0 with 1 open connector.
Duct <630995 Mitered Elbows> has 2 connectors and max flow 4.58.
. . .
Duct <631007 Short Radius> has 2 connectors and max flow 4.58.
Duct <631074 Mitered Elbows> has 2 connectors and max flow 0.
Duct <631075 Mitered Elbows> has 6 connectors and max flow 8.33 with 1 open connector.
Duct <631077 Mitered Elbows> has 2 connectors and max flow 4.58.
. . .
Duct <632298 Mitered Elbows> has 2 connectors and max flow 8.33.

Set MEP Duct Flow Parameter:
  Set max flow parameter on 43 ducts,
  2 of which have open connectors.

Here is FlowParam03.zip containing the complete source code with the updated method implementations using LINQ as described above, the Visual Studio solution and the add-in manifest for this add-in.

Autodesk University Class Catalog Preview

The AU 2013 class catalog preview (2.5 Mb xls) listing the classes available at Autodesk University in Las Vegas in December is now available for download.

I verified that mine are all present and intact:

Since popular classes often fill up quite quickly, you can use this spreadsheet to get started on your selections and help ensure that you can register for the classes you want when registration opens on September 12.

Songbird Dies, Long Live Nightingale

Completely unrelated to the Revit API, you may have noticed that I dabble with music now and then and was using Songbird a my main playing and tagging tool on Mac.

Well, Songbird shut down as a company in June, and I now moved on to Nightingale that is touted as its worthy successor and looking good to me so far.

I am also using VirtualDJ when I want to cross-fade nicely from one song to the next in a playlist.