Revit.SDK.Samples.DoorSwing.CS.DoorSwingData.AssignedAllRooms C# (CSharp) Method

AssignedAllRooms() private static method

Iterate through plan topology to determine if all plan circuits have assigned rooms.
private static AssignedAllRooms ( System.Windows.Forms.Document doc ) : bool
doc System.Windows.Forms.Document Revit project.
return bool
        private static bool AssignedAllRooms(Document doc)
        {
            PlanTopologySet planTopologies = doc.PlanTopologies;

             // Iterate plan topology for each level.
             foreach (PlanTopology planTopology in planTopologies)
             {
            PlanCircuitSet circuits = planTopology.Circuits;

            // Iterate each circuit in this plan topology.
            foreach (PlanCircuit circuit in circuits)
            {
               bool locatedRoom = circuit.IsRoomLocated;

               if (!locatedRoom)
               {
                  // If any circuit isn't assigned room, then method return false.
                  return locatedRoom;
               }
            }
             }

             return true;
        }