Revit.SDK.Samples.Rooms.CS.RoomsData.GetAllRoomsAndTags C# (CSharp) Méthode

GetAllRoomsAndTags() private méthode

get all the rooms and room tags in the project
private GetAllRoomsAndTags ( ) : void
Résultat void
        private void GetAllRoomsAndTags()
        {
            // get the active document
            Document document = m_revit.ActiveUIDocument.Document;
            RoomFilter roomFilter = new RoomFilter();
            RoomTagFilter roomTagFilter = new RoomTagFilter();
            LogicalOrFilter orFilter = new LogicalOrFilter(roomFilter, roomTagFilter);

            FilteredElementIterator elementIterator =
                (new FilteredElementCollector(document)).WherePasses(orFilter).GetElementIterator();
            elementIterator.Reset();

            // try to find all the rooms and room tags in the project and add to the list
            while (elementIterator.MoveNext())
            {
                object obj = elementIterator.Current;

                // 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;
                }

                // find the room tags
                RoomTag tmpTag = obj as RoomTag;
                if (null != tmpTag)
                {
                    m_roomTags.Add(tmpTag);
                    continue;
                }
            }
        }