Beispiel #1
0
        public ClassFloor parseFloor(Level floor)
        {
            ClassFloor cfl = new ClassFloor(floor.Name, new BindingList <ClassRoom>());

            cfl.id = floor.Id.ToString();
            return(cfl);
        }
Beispiel #2
0
        public BindingList <ClassFloor> getFloors()
        {
            FilteredElementCollector collector = new FilteredElementCollector(revitDocument);
            ICollection <Element>    floors    = collector.OfClass(typeof(Level)).ToElements();
            BindingList <ClassFloor> cfls      = new BindingList <ClassFloor>();

            foreach (Element fl in floors)
            {
                ClassFloor cfl = parseFloor((Level)fl);
                cfl.Rooms = getRooms((Level)fl);

                if (cfl.Rooms.Count != 0)
                {
                    cfls.Add(cfl);
                }
            }
            return(cfls);
        }