/// <summary> /// Doors related rooms: update one door's To/From room information or geometry. /// </summary> /// <param name="door">one door instance.</param> /// <param name="updateGeo"> /// true means update geometry else update To/From room information. /// </param> private static void UpdateFromToRoomofOneDoor(FamilyInstance door, bool updateGeo) { if (null == door.ToRoom && null == door.FromRoom) { return; } // update the door's geometry according to door's To/From room info. // standard: door.ToRoom should keep consistent with door.Room else need update. if ((null == door.Room) && (null == door.FromRoom)) { // only external door may have this status. // door.Room are consistent with door.FromRoom, so need update. if (updateGeo) // update geometry { door.flipHand(); door.flipFacing(); } else // update To/From Room. { door.FlipFromToRoom(); } } else if ((null != door.Room) && (null != door.FromRoom)) { // door.Room are consistent with door.FromRoom, so need update. if (door.Room.Id.IntegerValue.Equals(door.FromRoom.Id.IntegerValue)) { if (updateGeo) // update geometry { door.flipHand(); door.flipFacing(); } else // update To/From Room. { door.FlipFromToRoom(); } } } }