Esempio n. 1
0
        /// <summary>
        ///constructor
        /// </summary>
        public RoomsData(ThisApplication application)
        {
            m_thisApp = application;

            ElementFilter            filterRoom    = new ElementClassFilter(typeof(SpatialElement));
            FilteredElementCollector roomCollector = new FilteredElementCollector(m_thisApp.ActiveUIDocument.Document);

            roomCollector.WherePasses(filterRoom);

            foreach (Autodesk.Revit.DB.Element ee in roomCollector)
            {
                Room tmpRoom = ee as Room;
                if (null != tmpRoom)
                {
                    m_rooms.Add(tmpRoom);
                    continue;
                }
            }

            ElementFilter            filterRoomTag    = new ElementClassFilter(typeof(SpatialElementTag));
            FilteredElementCollector roomTagCollector = new FilteredElementCollector(m_thisApp.ActiveUIDocument.Document);

            roomTagCollector.WherePasses(filterRoomTag);

            foreach (Autodesk.Revit.DB.Element ee in roomTagCollector)
            {
                // find the room tags
                RoomTag tmpTag = ee as RoomTag;
                if (null != tmpTag)
                {
                    m_roomTags.Add(tmpTag);
                    continue;
                }
            }

            //find out the rooms that without tag
            ClassifyRooms();
        }
Esempio n. 2
0
 /// <summary>
 /// Default constructor of StructuralLayerFunction
 /// </summary>
 public SamplesRoom(ThisApplication hostApp)
 {
     // Init for varialbes
     // this application handler
     m_revit = hostApp;
 }