Using the Revit API to collect and count Curtain Panels (and Rooms and other “non-native” elements)

In the garden and natural world, “non-native” species can be invasives that lack predators and overwhelm the existing ecosystem.

For example, rooting and wallowing by non-native hogs causes extensive damage to the Great Smoky Mountains National Park.

Revit also has non-native classes like Curtain Panels and Rooms. They don’t root and wallow, but they can cause a minor complication as described in the video below.

Advertisements

4 thoughts on “Using the Revit API to collect and count Curtain Panels (and Rooms and other “non-native” elements)

  1. First, let me say that your videos have been very helpful in increasing my productivity!

    I was wondering if you wouldn’t mind posting a copy of some example code for this type of count? I am working on a high rise project, that was designed in Revit by another firm. I am eventually going to need to tag and schedule all the different types of curtain wall panels (of which there are hundreds). I would love to be able to run a macro that compiles/calculates sf/ and lists all the different types of curtain panels in this document.

    Any help you can give would be appreciated thanks!

    • Hi,

      Glad you are finding the site helpful! What code do you have so far? Have you tried a combination of a Class filter and Category filter (OfClass & OfCategory)?

      Harry

      • Right now my code looks like this.

        UIDocument vidoc = this.ActiveUIDocument;
        Document doc = vidoc.Document;
        IList panelList = new FilteredElementCollector(doc).OfClass(typeof(FamilyInstance)).OfCategory(BuiltInCategory.OST_CurtainWallPanels).ToList();
        TaskDialog.Show(“Curtain Wall Count”,panelList.Count.ToString());

        My ultimate goal is to count the panels on a per level basis, going counterclockwise around the building. I have a parameter made and assigned as panel unit number (which is just the assembly number) and a tag made with that parameter in it.

        As opposed to going into each tag and manually entering the number I would like for this to count the panels, and then assign the number into that parameter.

        • Looks like you are heading in the right direction. But how are the panels associated with a level? Can you use the Base Constraint of the wall hosting the panel? Or do your walls span multiple levels? If you’d like some additional consulting on this, please use the “contact” link above.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s