Announcement

Collapse
No announcement yet.

Sticky Notes: Revit API - Skipping Unplaced Rooms

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sticky Notes: Revit API - Skipping Unplaced Rooms

    Using Revit API, if you want to collect all "Placed" rooms in a given Revit project file and want to skip all "Unplaced" rooms then use the following method.

    Get "All" rooms in a project file using standard filter collector method and iterate through each room object to check the following before you add them to your final "Placed Rooms" collection.


    // find the rooms, skip those rooms which are not placed but exist in a project file. Checking if Area property of room is 0.0 and location property is null.

    Room tmpRoom = obj as Room;
    if (null != tmpRoom.Location && Math.Round(tmpRoom.Area) != 0.0)
    {
    m_rooms.Add(tmpRoom);
    continue;
    }


    The reason why I list this method here is because I used the following up until now and it worked well but for some reason it stopped working in Revit 2013 API while I was updating my plugins. When I checked using Revit snoop database..all unplaced rooms show Level property that they were last placed and deleted and show null property in object type.


    // find the rooms, skip those rooms which don't locate at Level yet.

    Room tmpRoom = obj as Room;
    if (null != tmpRoom && null != tmpRoom.Level)
    {
    m_rooms.Add(tmpRoom);
    continue;
    }




    Click here to view the entire blog post.

Related Topics

Collapse

Working...
X