(2025-04-10 기준) 설계품질검토용 건축법 및 관련법규 - KBIMCode (문장단위)
      KBIMCode - KBimAssess Python Code     KBIMCode - 체크리스트 단위     KBIMCode - 조항단위
  ◁prev 1   2   3   4   next▷  
2 / 4 page Total 2500 / 4000 records
Select
ALL
None
#
Law
Jo
JO Name
HANG
HO
MOK
Text
Search!
1
건축법 시행령 제 52조 3호

3. 제2종 근린생활시설 중 일반음식점, 휴게음식점 및 제과점의 조리장과 숙박시설의 욕실





//건축법 시행령 52조 (거실 등의 방습) 3호

Check(EDBA_52_0_3){

KS

}



KS{

Building myBuilding1{
Building.usage = "ClassiiNeighborhoodLivingFacilites.Restaurant" OR "ClassiiNeighborhoodLivingFacilites.RestingRestaurant" OR "ClassiiNeighborhoodLivingFacilites.Bakery"
}
Building myBuilding2{
Building.usage = "ClassiiNeighborhoodLivingFacilites.LodgingFacility" 
}

getSpaceUsage(myBuilding1.Space)="Kitchen"

getSpaceUsage(myBuilding2.Space)="BathRoom"


} 




Python Code 변환 예정



2
건축법 시행령 제 53조 1 항 2호

2. 공동주택 중 기숙사의 침실, 의료시설의 병실, 교육연구시설 중 학교의 교실 또는 숙박시설의 객실 간 경계벽





// 건축법 시행령 53조 (경계벽 등의 설치) 1항 2호



check(EDBA_53_1_1){

	KS

}

KS{


Space mySpace1{

Space.Building.usage = “MultiUnitHouse.Dormitory”

Space.name = “BedRoom”

}



Space mySpace1_1{

Space.Building.usage = “MultiUnitHouse.Dormitory”

Space.name != “BedRoom”

}



Space mySpace2{

Space.Building.usage = “MedicalFacility”

Space.name = “Ward”

}



Space mySpace2_1{

Space.Building.usage = “MedicalFacility”

Space.name != “Ward”

}



Space mySpace3{

Space.Building.usage = “EducationAndResearchFacility.School”

Space.name = “ClassRoom”

}

Space mySpace3_1{

Space.Building.usage = “EducationAndResearchFacility.School”

Space.name != “ClassRoom”

}



Space mySpace4{

Space.Building.usage = “LodgingFacility”

Space.name = “GuestRoom”

}

Space mySpace4_1

Space.Building.usage = “LodgingFacility”

Space.name != “GuestRoom”

}



Wall myWall1{

isObjectProperty(Wall.isPartitionWall)=TRUE

hasObject(mySpace1, Wall) =TRUE

}



Wall myWall2{

isObjectProperty(Wall.isPartitionWall)=TRUE

hasObject(mySpace2, Wall) =TRUE

}



Wall myWall3{

isObjectProperty(Wall.isPartitionWall)=TRUE

hasObject(mySpace3, Wall) =TRUE

}



Wall myWall4{

isObjectProperty(Wall.isPartitionWall)=TRUE

hasObject(mySpace4, Wall) =TRUE

}



(hasObject(mySpace1, myWall) =TRUE

hasObject(mySpace1_1, myWall) =FALSE)

OR

(hasObject(mySpace2, myWall) =TRUE

hasObject(mySpace2_1, myWall) =FALSE)

OR

(hasObject(mySpace3, myWall) =TRUE

hasObject(mySpace3_1, myWall) =FALSE)

OR

(hasObject(mySpace4, myWall) =TRUE

hasObject(mySpace4_1, myWall) =FALSE)



} 




Python Code 변환 예정



3
건축법 시행령 제 53조 1 항 3호

3. 제2종 근린생활시설 중 다중생활시설의 호실 간 경계벽





// 건축법 시행령 53조 (경계벽 등의 설치) 1항 3호



check(EDBA_53_1_3){

	KS

}


KS{

Space mySpace1{

Space.Building.usage = “ClassIINeighborhoodLivingFacility.CommunalLivingFacility”

}



Wall myWall{

isObjectProperty(Wall.isPartitionWall)=TRUE
hasObject(mySpace1, Wall) =TRUE
}



isObjectProperty(myWall.isSharedByHouseholds) = TRUE


} 




Python Code 변환 예정



4
건축법 시행령 제 53조 1 항 4호

4. 노유자시설 중 「노인복지법」 제32조제1항제3호에 따른 노인복지주택(이하 "노인복지주택"이라 한다)의 각 세대 간 경계벽





// 건축법 시행령 53조 (경계벽 등의 설치) 1항 4호





check(EDBA_53_1_4){

	KS

}


KS{

Building  myBuilding{

Zone.Building.usage = “FacilitiesForTheAgedAndChildren.WelfareFacilityForTheAged ”

getResult(WOPA_32_1_3)=TRUE

}



Wall myWall{

isObjectProperty(Wall.isPartitionWall)=TRUE
hasObject(myBuilding, Wall) =TRUE
}



isObjectProperty(myWall.isSharedByHouseholds) = TRUE



} 




Python Code 변환 예정



5
건축법 시행령 제 53조 2 항 1호

1. 단독주택 중 다가구주택





//건축법 시행령 53조 (경계벽 등의 설치) 2항 1호

Check(EDBA_53_2_1){
   KS
}

KS{
   getBuildingUsage()="DetachedHouse.MultiFamilyHouse"
}  




Python Code 변환 예정



6
건축법 시행령 제 53조 2 항 3호

3. 업무시설 중 오피스텔





//건축법 시행령 53조 (경계벽 등의 설치) 2항 3호

Check(EDBA_53_2_3){
   KS
}

KS{
   getBuildingUsage()="BusinessFacility.Officetel"
   
}  




Python Code 변환 예정



7
건축법 시행령 제 53조 2 항 4호

4. 제2종 근린생활시설 중 다중생활시설





//건축법 시행령 53조 (경계벽 등의 설치) 2항 4호

Check(EDBA_53_2_4){
   KS
}

KS{
   getBuildingUsage()="ClassIINeighborhoodLivingFacility.CommunalLivingFacility"
   
}  




Python Code 변환 예정



8
건축법 시행령 제 53조 2 항 5호

5. 숙박시설 중 다중생활시설





//건축법 시행령 53조 (경계벽 등의 설치) 2항 5호

Check(EDBA_53_2_5){
   KS
}

KS{
   getBuildingUsage()="LodgingFacility.CommunalLivingFacility"
   
}  




Python Code 변환 예정



9
건축법 시행령 제 58조 1호

1. 연면적 30제곱미터 미만인 단층 부속건축물로서 외벽 및 처마면이 내화구조 또는 불연재료로 된 것





check(EDBA_58_0_1){

	getGrossFloorArea() < 30m2;

	isObjectProperty(Building.isAttachedBuilding) = TRUE

	getBuildingStoriesCount() = 1;

	isFireResistantStructure(MainStructure) = TRUE

	OR isFireResistantStructure(ExternalWall) = TRUE;

} 




Python Code 변환 예정



10
건축법 시행령 제 58조 2호

2. 도매시장의 용도로 쓰는 건축물로서 그 주요구조부가 불연재료로 된 것





check(EDBA_58_0_2){

	getBuildingUsage() < "WholeSale Market"

	isFireResistantStructure(MainStructure) = TRUE

} 




Python Code 변환 예정



11
건축법 시행령 제 80조 1호

1. 주거지역: 60제곱미터





//건축법 시행령 80조 (건축물이 있는 대지의 분할제한) 1호

Check(EDBA_80_1){
     IF CS THEN KS
}
CS{
	getBuildingUsage() = "ResidentialArea"
}
KS{
	getObjectProperty(Building.Site.area) >= 60m2
} 




Python Code 변환 예정



12
건축법 시행령 제 80조 2호

2. 상업지역: 150제곱미터






//건축법 시행령 80조 (건축물이 있는 대지의 분할제한) 2호

Check(EDBA_80_2){
     IF CS THEN KS
}
CS{
	getBuildingUsage() = "CommercialArea"
}
KS{
	getObjectProperty(Building.Site.area) >= 150m2
} 




Python Code 변환 예정



13
건축법 시행령 제 80조 3호

3. 공업지역: 150제곱미터





//건축법 시행령 80조 (건축물이 있는 대지의 분할제한) 3호

Check(EDBA_80_3){
     IF CS THEN KS
}
CS{
	getBuildingUsage() = "IndustrialArea"
}
KS{
	getObjectProperty(Building.Site.area) >= 150m2
} 




Python Code 변환 예정



14
건축법 시행령 제 80조 4호

4. 녹지지역: 200제곱미터





//건축법 시행령 80조 (건축물이 있는 대지의 분할제한) 4호

Check(EDBA_80_4){
     IF CS THEN KS
}
CS{
	getBuildingUsage() = "GreenArea"
}
KS{
	getObjectProperty(Building.Site.area) >= 200m2
}
 




Python Code 변환 예정



15
건축법 시행령 제 80조 5호

5. 제1호부터 제4호까지의 규정에 해당하지 아니하는 지역: 60제곱미터





//건축법 시행령 80조 (건축물이 있는 대지의 분할제한) 5호

Check(EDBA_80_5){
     IF CS THEN KS
}
CS{
	getBuildingUsage() != "ResidentialArea"
	getBuildingUsage() != "CommercialArea"	
	getBuildingUsage() != "IndustrialArea"
	getBuildingUsage() != "GreenArea"
}
KS{
	getObjectProperty(Building.Site.area) >= 60m2
} 




Python Code 변환 예정



16
건축법 시행령 제 61조 1 항 4호

4. 공장의 용도로 쓰는 건축물. 다만, 건축물이 1층 이하이고, 연면적 1천 제곱미터 미만으로서 다음 각 목의 요건을 모두 갖춘 경우는 제외한다.





Check(EDBA_61_1_4){
IF !CS THEN KS}


CS{
getResult(EDBA_61_1_4_가)=PASS
OR getResult(EDBA_61_1_4_나)=PASS 
OR getResult(EDBA_61_1_4_다)=PASS
}


KS{
getBuildingUsage="Factory"} 




Python Code 변환 예정



17
건축법 시행령 제 61조 2 항 1호

1. 상업지역(근린상업지역은 제외한다)의 건축물로서 다음 각 목의 어느 하나에 해당하는 것





// 건축법 시행령 61조 (건축물의 마감재료) 2항 1호


Check(EDBA_61_2_1){
       KS
}




KS{
    getObjectProperty(Building.SpecialPurposeArea.type) = "CommercialArea"
    getResult(EDBA_61_2_1_가)=TRUE
  

} 




Python Code 변환 예정



18
건축법 시행령 제 61조 1 항 3호

3. 위험물저장 및 처리시설(자가난방과 자가발전 등의 용도로 쓰는 시설을 포함한다), 자동차 관련 시설, 방송통신시설 중 방송국ㆍ촬영소 또는 발전시설의 용도로 쓰는 건축물





Check(EDBA_61_1_3){
KS}


KS{
getBuildingUsage()="FacilityForStorageAndTreatmentOfDangerousSubstance"
OR getBuildingUsage()="FacilityForMotorVehicle"
OR (getBuildingUsage()="FacilityForBroadcastingAndTelecommunication.BroadcastingStation"
OR getBuildingUsage()="FacilityForBroadcastingAndTelecommunication.Studio"
OR getBuildingUsage()="FacilityForBroadcastingAndTelecommunication.PowerPlant"
} 




Python Code 변환 예정



19
건축법 시행령 제 39조 1 항 5호

5. 업무시설 중 국가 또는 지방자치단체의 청사





// 건축법 시행령 39조 (건축물 바깥쪽으로의 출구 설치) 1항 5호

Check(EDBA_39_1_5){     
KS
}

KS {
Building myBuilding{
getBuildingUsage() = “BusinessFacility.GovernmentOfficeBuilding”
}

isExist(myBuliding) = TRUE
}
 








target_bldg_type_1 = ['제2종 근린생활시설', '문화 및 집회시설', '종교시설', '판매시설', '업무시설', '창고시설', '교육연구시설', '장례시설', '승강기를 설치하여야하는 건축물']
target_bldg_sub_type_2 = ['판매시설']
max_route_length_stair_to_door = 30
max_route_length_space_to_door = 60
min_em_door_count = 2
min_em_door_h = 1.5
min_em_door_w = 0.75

target_bldg_types_1_label = '외부 출입구 방향 적용 대상 건출물 용도'
target_bldg_types_2_label = '외부 출입구 유효너비 대상 건출물 용도'

max_route_length_stair_to_door_label = '직통계단과 외부 출입구 간 최소거리'
max_route_length_space_to_door_label = '거실과 외부 출입구 간 최소거리'
min_em_door_count_label = '최소 비상구 개수'
min_em_door_h_label = '최소 비상구 높이'
min_em_door_w_label = '최소 비상구 유효너비'

def Check():
    for building in SELECT('building'):
        bldg_type = building.SELECT('building type').STRING()
        sub_type = building.SELECT('prop', '세부용도').STRING()
        if (bldg_type in target_bldg_type_1):
            if bldg_type == '제2종 근린생활시설' and sub_type in ['공연장', '종교집회장', '인터넷컴퓨터게임시설제공업소']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '문화 및 집회시설' and sub_type in ['전시장', '동물원', '식물원']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '업무시설' and sub_type == '청사':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '교육연구시설' and sub_type == '학교':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            message =  '검토 대상 건물입니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)

        else:
            message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)
            break



        evac_storey_exist = False
        stories = building.SELECT('storey')

        for storey in stories:
            if storey.SELECT('is evacuation storey').BOOL() == True:
                evac_storey_exist = True
                break

        if evac_storey_exist == False:
            ERROR('피난층이 존재하지 않습니다.')
            return

        for storey in stories:
            stairs = storey.SELECT('direct stair')

            if stairs.COUNT() == 0:
                storey.ERROR(storey.SELECT('name').STRING() + '에 직통계단이 존재하지 않습니다.')
                continue

            exDoors = []
            for door in storey.SELECT('door'):
                if door.SELECT('is external').BOOL() == True:
                    exDoors.append(door)

            for stair in stairs:
                route_length = -1
                for route in stair.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_stair_to_door:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    stair.SUCCESS(stair.SELECT('name').STRING() + ' : ' + str(route_length))

            spaces = storey.SELECT('space')

            for space in spaces:
                route_length = -1
                for route in space.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_space_to_door:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    space.SUCCESS(space.SELECT('name').STRING() + ' : ' + str(route_length))

            if bldg_type in target_bldg_types_1:
                for door in exDoors:
                    if door.SELECT('is inward').BOOL():
                        door.ERROR('외부 출입구의 방향이 안여닫이입니다.')

                for space in spaces:
                    code = space.SELECT('class code').STRING()
                    if not code in theater_space_codes:
                        continue
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area < 300:
                        continue
                    emExits = []
                    for door in space.SELECT('space door'):
                        if door.SELECT('prop', '비상구').BOOL() or door.SELECT('prop', '보조출입구').BOOL():
                            emExits.append(door)
                    if len(emExits) < min_em_door_count:
                        space.ERROR('비상구(보조출입구) 개수:' + str(len(emExits)) + '(<' + str(min_em_door_count) + ')')
                        continue
                    em_exit_count = 0
                    for exit in emExits:
                        if exit.SELECT('clear opening').UNIT('m').NUMBER() >= min_em_door_w and exit.SELECT('height').UNIT('m').NUMBER() >= min_em_door_h:
                            em_exit_count += 1
                    if em_exit_count < min_em_door_count:
                        space.ERROR('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(<' + str(min_em_door_count) + ')')
                    else:
                        space.SUCCESS('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(>=' + str(min_em_door_count) + ')')

            if bldg_type in target_bldg_types_2:
                if storey.SELECT('is evacuation storey').BOOL() == False:
                    continue
                max_area = 0;
                for space in spaces:
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area > max_area:
                        max_area = area
                min_door_w = max_area / 100 * 0.6;

                for door in exDoors:
                    width = door.SELECT('clear opening').UNIT('m')
                    w = width.NUMBER()
                    if (w < min_door_w):
                        width.ERROR('출구 유효너비:' + str(w) + '(<' + str(min_door_w) + ')')
                    else:
                        width.SUCCESS('출구 유효너비:' + str(w) + '(>=' + str(min_door_w) + ')')
 





20
건축법 시행령 제 39조 1 항 10호

10. 승강기를 설치하여야 하는 건축물





// 건축법 시행령 39조 (건축물 바깥쪽으로의 출구 설치) 1항 10호

Check(EDBA_39_1_10){     
KS
}


KS {
Building myBuilding{
hasObject(Building, Elevator)
}

isExist(myBuliding) = TRUE
}
 








target_bldg_type_1 = ['제2종 근린생활시설', '문화 및 집회시설', '종교시설', '판매시설', '업무시설', '창고시설', '교육연구시설', '장례시설', '승강기를 설치하여야하는 건축물']
target_bldg_sub_type_2 = ['판매시설']
max_route_length_stair_to_door = 30
max_route_length_space_to_door = 60
min_em_door_count = 2
min_em_door_h = 1.5
min_em_door_w = 0.75

target_bldg_types_1_label = '외부 출입구 방향 적용 대상 건출물 용도'
target_bldg_types_2_label = '외부 출입구 유효너비 대상 건출물 용도'

max_route_length_stair_to_door_label = '직통계단과 외부 출입구 간 최소거리'
max_route_length_space_to_door_label = '거실과 외부 출입구 간 최소거리'
min_em_door_count_label = '최소 비상구 개수'
min_em_door_h_label = '최소 비상구 높이'
min_em_door_w_label = '최소 비상구 유효너비'

def Check():
    for building in SELECT('building'):
        bldg_type = building.SELECT('building type').STRING()
        sub_type = building.SELECT('prop', '세부용도').STRING()
        if (bldg_type in target_bldg_type_1):
            if bldg_type == '제2종 근린생활시설' and sub_type in ['공연장', '종교집회장', '인터넷컴퓨터게임시설제공업소']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '문화 및 집회시설' and sub_type in ['전시장', '동물원', '식물원']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '업무시설' and sub_type == '청사':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '교육연구시설' and sub_type == '학교':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            message =  '검토 대상 건물입니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)

        else:
            message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)
            break



        evac_storey_exist = False
        stories = building.SELECT('storey')

        for storey in stories:
            if storey.SELECT('is evacuation storey').BOOL() == True:
                evac_storey_exist = True
                break

        if evac_storey_exist == False:
            ERROR('피난층이 존재하지 않습니다.')
            return

        for storey in stories:
            stairs = storey.SELECT('direct stair')

            if stairs.COUNT() == 0:
                storey.ERROR(storey.SELECT('name').STRING() + '에 직통계단이 존재하지 않습니다.')
                continue

            exDoors = []
            for door in storey.SELECT('door'):
                if door.SELECT('is external').BOOL() == True:
                    exDoors.append(door)

            for stair in stairs:
                route_length = -1
                for route in stair.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_stair_to_door:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    stair.SUCCESS(stair.SELECT('name').STRING() + ' : ' + str(route_length))

            spaces = storey.SELECT('space')

            for space in spaces:
                route_length = -1
                for route in space.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_space_to_door:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    space.SUCCESS(space.SELECT('name').STRING() + ' : ' + str(route_length))

            if bldg_type in target_bldg_types_1:
                for door in exDoors:
                    if door.SELECT('is inward').BOOL():
                        door.ERROR('외부 출입구의 방향이 안여닫이입니다.')

                for space in spaces:
                    code = space.SELECT('class code').STRING()
                    if not code in theater_space_codes:
                        continue
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area < 300:
                        continue
                    emExits = []
                    for door in space.SELECT('space door'):
                        if door.SELECT('prop', '비상구').BOOL() or door.SELECT('prop', '보조출입구').BOOL():
                            emExits.append(door)
                    if len(emExits) < min_em_door_count:
                        space.ERROR('비상구(보조출입구) 개수:' + str(len(emExits)) + '(<' + str(min_em_door_count) + ')')
                        continue
                    em_exit_count = 0
                    for exit in emExits:
                        if exit.SELECT('clear opening').UNIT('m').NUMBER() >= min_em_door_w and exit.SELECT('height').UNIT('m').NUMBER() >= min_em_door_h:
                            em_exit_count += 1
                    if em_exit_count < min_em_door_count:
                        space.ERROR('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(<' + str(min_em_door_count) + ')')
                    else:
                        space.SUCCESS('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(>=' + str(min_em_door_count) + ')')

            if bldg_type in target_bldg_types_2:
                if storey.SELECT('is evacuation storey').BOOL() == False:
                    continue
                max_area = 0;
                for space in spaces:
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area > max_area:
                        max_area = area
                min_door_w = max_area / 100 * 0.6;

                for door in exDoors:
                    width = door.SELECT('clear opening').UNIT('m')
                    w = width.NUMBER()
                    if (w < min_door_w):
                        width.ERROR('출구 유효너비:' + str(w) + '(<' + str(min_door_w) + ')')
                    else:
                        width.SUCCESS('출구 유효너비:' + str(w) + '(>=' + str(min_door_w) + ')')
 





21
건축법 시행령 제 41조 1 항 1호 가 목

가. 단독주택: 유효 너비 0.9미터 이상





Check(EDBA_41_1_1){

  IF (CS) THEN KS END IF 

}

CS{

getObjectProperty(Building.usage)="DetachedHouse"

}

KS{

  getObjectProperty(Passage.effectiveWidth)> 0.9M

} 








def Check():
    if SELECT("building type").STRING() == "DetachedHouse":
        passage = SELECT("passage")
        if passage.SELECT("clear width").UNIT("m").NUMBER()> 0.9:
            passage.SUCCESS("pass")
        else:
            passage.ERROR("fail")
 





22
건축법 시행령 제 41조 1 항 1호 다 목

다. 그 밖의 용도로 쓰는 건축물: 유효 너비 1.5미터 이상





Check(EDBA_41_1_3){

IF (CS) THEN KS END IF

}

CS{

Building.usage !="DetachedHouse"

OR   Building.usage !="CulturalAndAssemblyFacility"

   OR Building.usage !="ReligiousFacility" 

   OR  Building.usage !="MedicalFacility" 

   OR Building.usage !="AmusementFacility" 

   OR Building.usage !="FuneralParlor"  
}

KS{

 getObjectProperty(Passage.effectiveWidth)> 1.5m ;

} 








target_bldg_uses_01 = ['단독주택']
target_bldg_uses_02 = ['문화 및 집회시설', '장례시설', '의료시설', '위락시설']

target_bldg_uses_01_label = '건축물 용도1'
target_bldg_uses_02_label = '건축물 용도2'

def Check():
    for building in SELECT('building'):
        bldg_use = building.SELECT('building type').STRING()
        min_corridor_w = 1.5
        min_area = 0.0

        if bldg_use in target_bldg_uses_01:
            min_corridor_w = 0.9
        elif bldg_use in target_bldg_uses_02:
            min_corridor_w = 3.0
            min_area = 500

        if min_area > 0:
            area = 0
            for space in building.SELECT('space'):
                area += space.SELECT('area').UNIT('m2').NUMBER()
            if area < min_area:
                building.SUCCESS('바닥면적의 합: ' + str(area) + ' < ' + str(min_area))
                continue

        base_storey = None
        stories = building.SELECT('storey')

        for storey in stories:
            if storey.SELECT('prop', '기준 지상층').BOOL() == True:
                base_storey = storey
                break

        if base_storey is None:
            building.ERROR('기준 지상층이 존재하지 않습니다.')
            break

        stairs = base_storey.SELECT('direct stair')

        if stairs.COUNT() == 0:
            base_storey.ERROR(base_storey.SELECT('name').STRING() + '에 직통계단이 존재하지 않습니다.')
            continue

        exDoors = []
        for door in base_storey.SELECT('door'):
            if door.SELECT('is external').BOOL() == True:
                exDoors.append(door)

        for stair in stairs:
            for route in stair.SELECT('escape route', exDoors):
                for space in route.SELECT('passing space'):
                    width = space.SELECT('min clear width').UNIT('m')
                    w = width.NUMBER()
                    if w < min_corridor_w:
                        width.ERROR('통로 너비: ' + str(w) + ' < ' + str(min_corridor_w))
                    else:
                        width.SUCCESS('통로 너비: ' + str(w) + ' >= ' + str(min_corridor_w)) 





23
건축법 시행령 제 51조 2 항 1호 가 목

가. 제2종 근린생활시설 중 공연장, 종교집회장, 인터넷컴퓨터게임시설제공업소 및 다중생활시설(공연장, 종교집회장 및 인터넷컴퓨터게임시설제공업소는 해당 용도로 쓰는 바닥면적의 합계가 각각 300제곱미터 이상인 경우만 해당한다)





//건축법 시행령 51조 (거실의 채광 등) 2항 1호
Check(EDBA_51_2_1){
	KS1 OR KS2
}	
KS1{
	Space mySpace{
		getBuildingUsage() = "ClassIINeighborhoodLivingFacility.PerformanceHall"
		OR getBuildingUsage() = "ClassIINeighborhoodLivingFacility.ReligiousAssemblyFacility"
		OR getBuildingUsage() = "ClassIINeighborhoodLivingFacility.FacilityForProvidingInternetComputerGameService"	
	}

	getFloorArea(mySpace) >= 300 m2
}

KS2{
	getBuildingUsage() = "ClassIINeighborhoodLivingFacility.CommunalLivingFacilities"
}
 




Python Code 변환 예정



24
건축법 시행령 제 51조 2 항 1호 나 목

나. 문화 및 집회시설





//건축법 시행령 51조 (거실의 채광 등) 2항 2호
Check(EDBA_51_2_2){
	getBuildingUsage() = "CulturalAndAssemblyFacility"
} 




Python Code 변환 예정



25
건축법 시행령 제 51조 2 항 1호 다 목

다. 종교시설





//건축법 시행령 51조 (거실의 채광 등) 2항 3호
Check(EDBA_51_2_3){
	getBuildingUsage() = "ReligiousFacility"
} 




Python Code 변환 예정



26
건축법 시행령 제 51조 2 항 1호 라 목

라. 판매시설





Check(EDBA_51_2_4){

  getBuildingUsage()="CommercialFacility"

} 




Python Code 변환 예정



27
건축법 시행령 제 51조 2 항 1호 마 목

마. 운수시설





//건축법 시행령 51조 (거실의 채광 등) 2항 5호
Check(EDBA_51_2_5){
	getBuildingUsage() = "TransportationFacility"
} 




Python Code 변환 예정



28
건축법 시행령 제 51조 2 항 1호 바 목

바. 의료시설(요양병원 및 정신병원은 제외한다)





//건축법 시행령 51조 (거실의 채광 등) 2항 6호
Check(EDBA_51_2_6){
	getBuildingUsage() = "MedicalFacility"
} 




Python Code 변환 예정



29
건축법 시행령 제 51조 2 항 1호 사 목

사. 교육연구시설 중 연구소





//건축법 시행령 51조 (거실의 채광 등) 2항 7호
Check(EDBA_51_2_7){
	getBuildingUsage() = "EducationAndResearchFacility.Laboratory"
} 




Python Code 변환 예정



30
건축법 시행령 제 51조 2 항 1호 아 목

아. 노유자시설 중 아동 관련 시설, 노인복지시설(노인요양시설은 제외한다)





//건축법 시행령 51조 (거실의 채광 등) 2항 8호
Check(EDBA_51_2_8){
	getBuildingUsage() = "FacilitiesForTheAgedAndChildren.ChildrenRelatedFacilities"
	OR getBuildingUsage() = "FacilitiesForTheAgedAndChildren.WelfareFacilitiesForTheAged"
} 




Python Code 변환 예정



31
건축법 시행령 제 51조 2 항 1호 자 목

자. 수련시설 중 유스호스텔





//건축법 시행령 51조 (거실의 채광 등) 2항 9호
Check(EDBA_51_2_9){
	getBuildingUsage() = "Trainingfacility.YouthHostels"
} 




Python Code 변환 예정



32
건축법 시행령 제 51조 2 항 1호 차 목

차. 운동시설





//건축법 시행령 51조 (거실의 채광 등) 2항 10호
Check(EDBA_51_2_10){
	getBuildingUsage() = "SportsFacility"
} 




Python Code 변환 예정



33
건축법 시행령 제 51조 2 항 1호 카 목

카. 업무시설





//건축법 시행령 51조 (거실의 채광 등) 2항 11호
Check(EDBA_51_2_11){
	getBuildingUsage() = "BusinessFacility"
} 




Python Code 변환 예정



34
건축법 시행령 제 51조 2 항 1호 타 목

타. 숙박시설





//건축법 시행령 51조 (거실의 채광 등) 2항 12호
Check(EDBA_51_2_12){
	getBuildingUsage() = "LodgingFacility"
} 




Python Code 변환 예정



35
건축법 시행령 제 51조 2 항 1호 파 목

파. 위락시설





//건축법 시행령 51조 (거실의 채광 등) 2항 13호
Check(EDBA_51_2_13){
	getBuildingUsage() = "AmusementFacility"
} 




Python Code 변환 예정



36
건축법 시행령 제 51조 2 항 1호 하 목

하. 관광휴게시설





//건축법 시행령 51조 (거실의 채광 등) 2항 14호
Check(EDBA_51_2_14){
	getBuildingUsage() = "FacilityForTourismAndRelaxation"
} 




Python Code 변환 예정



37
건축법 시행령 제 53조 1 항 1호

1. 단독주택 중 다가구주택의 각 가구 간 또는 공동주택(기숙사는 제외한다)의 각 세대 간 경계벽(제2조제14호 후단에 따라 거실·침실 등의 용도로 쓰지 아니하는 발코니 부분은 제외한다)





// 건축법 시행령 53조 (경계벽 등의 설치) 1항 1호



check(EDBA_53_1_1){

	KS

}




KS{



Zone myZone1{

Zone.Building.usage = “DetachedHouse.MultiFamilyHouse ”

}



Zone myZone2{

Zone.Building.usage = “MultiUnitHouse”

}



Balcony myBalcony{

Balcony.usage != “BedRoom”

Balcony.usage != “LivingRoom”

}



Wall myWall1{

isObjectProperty(Wall.isPartitionWall)=TRUE

hasObject(myZone1.Household, Wall) =TRUE

hasObject(myBalcony,Wall) =FALSE

}



Wall myWall1{

isObjectProperty(Wall.isPartitionWall)=TRUE

hasObject(myZone2.Household, Wall) =TRUE

hasObject(myBalcony,Wall) =FALSE

}





isExist(myWall1)=TRUE

isExist(myWall2)=TRUE



} 




Python Code 변환 예정



38
건축법 시행령 제 61조 1 항 1호

1. 단독주택 중 다중주택·다가구주택





Check(EDBA_61_1_1){

IF CS THEN KS

}



Floor myfloor1 {  

isObjectProperty(ClassIINeighborhoodLivingFacility.PerformanceHall)=TRUE

OR isObjectProperty(ClassIINeighborhoodLivingFacility.ReligiousAssemblyFacility)=TRUE

OR isObjectProperty(ClassIINeighborhoodLivingFacility.ReligiousAssemblyFacility)=TRUE

AND getFloorArea()>=300

}



CS{

isExist(myfloor1)=TRUE

OR(getBuildingUsage()= "CulturalAndAssemblyFacility"

AND getBuildingUsage()!= "CulturalAndAssemblyFacility.WeddingHall")

OR getBuildingUsage()= "ReligiousFacility"

OR getBuildingUsage()= "CommercialFacility"

OR getBuildingUsage()= "TransportationFacility"

OR (getBuildingUsage()= "AmusementFacility"

OR (getBuildingUsage()!= "AmusementFacility.Pubs"

AND getBuildingUsage()!= "AmusementFacility.BarBusiness")

}





KS{

getFloorArea(Room)>=200m2

OR (isObjectProperty(MainStructuralPart.isFireResistantStructure)=TRUE

OR isObjectProperty(MainStructuralPart.Material.nonCombustibility)=TRUE

getFloorArea(Room)>=400m2

} 




Python Code 변환 예정



39
건축법 시행령 제 61조 1 항 2호

2. 제2종 근린생활시설 중 공연장·종교집회장·인터넷컴퓨터게임시설제공업소·학원·독서실·당구장·다중생활시설의 용도로 쓰는 건축물





Check(EDBA_61_1_2){

IF CS THEN KS1 OR KS2}



Building myBuilding{

getBuildingUsage()="DetachedHouse.Multi-userHouses"

OR getBuildingUsage()="DetachedHouse.Multi-familyHouses" 

OR getBuildingUsage()="ClassIINeighborhoodLivingFacility.EducationalInstitute"

OR getBuildingUsage()="ClassIINeighborhoodLivingFacility.ReadingRooms

OR getBuildingUsage()="ClassIINeighborhoodLivingFacility.CommunalLivingFacility 

OR getBuildingUsage()="ClassIINeighborhoodLivingFacility.LodgingFacility"

OR getBuildingUsage()="ClassIINeighborhoodLivingFacility.MedicalFacility"

OR getBuildingUsage()="EducationAndResearchFacility.EducationalInstitute"

OR getBuildingUsage()="BusinessFacility.Oofficetels"

OR getBuildingUsage()="FuneralParlors"

}



MBU = getObjectUsage(myBuilding)



CS{

getBuildingUsage() = MBU



Floor myfloor{

Floor.number>=3

}



KS1{

(Floor.number>=3

AND getTotalfloorarea(Room)>=200m2)





KS2{isObjectProperty(MainStructuralPart.isFireResistantStructure)=TRUE

OR isObjectProperty(MainStructuralPart.Material.nonCombustibility)=TRUE

AND Floor.number>=3

getTotalfloorarea(Room)>=200m2

} 




Python Code 변환 예정



40
건축법 시행령 제 61조 2 항 1호 가 목

가. 제1종 근린생활시설, 제2종 근린생활시설, 문화 및 집회시설, 종교시설, 판매시설, 의료시설, 교육연구시설, 노유자시설, 운동시설 및 위락시설의 용도로 쓰는 건축물로서 그 용도로 쓰는 바닥면적의 합계가 2천제곱미터 이상인 건축물





//건축법 시행령 61조 (건축물의 마감재료) 2항 1호 가목

Check(EDBA_61_2_1_가){
            KS 
}



KS{
   Building myBuilding{
    getResult(SASP_2_1_1)=True
   }

  FloorSlab myFloorSlab{

     //   getFloorUsage()=myBuilding.usage
  }
  
   getObjectArea(myFloorSlab)>2000 m2

   
} 




Python Code 변환 예정



41
건축법 시행령 제 61조 2 항 2호

2. 6층 이상 또는 높이 22미터 이상인 건축물





//  건축법 시행령 61조 (건축물의 마감재료) 2항 2호
Check(EDBA_61_2_2){
	KS
}

KS{
	getObjectProperty(Building.isHighriseBuilding) = TRUE
	OR getObjectProperty(Building.isQuasiHighriseBuilding) = TRUE
} 




Python Code 변환 예정



42
건축법 시행령 제 53조 2 항 2호

2. 공동주택(「주택법」 제15조에 따른 주택건설사업계획승인 대상은 제외한다)





//건축법 시행령 53조 (경계벽 등의 설치) 2항 2호

Check(EDBA_53_2_2){
   KS
}

KS{
   getBuildingUsage()="MultiUnitHouse"
   getResult(Unimplemented_HA_16)=False
}  




Python Code 변환 예정



43
건축법 시행령 제 41조 1 항 1호 나 목

나. 바닥면적의 합계가 500제곱미터 이상인 문화 및 집회시설, 종교시설, 의료시설, 위락시설 또는 장례시설: 유효 너비 3미터 이상





Check(EDBA_41_1_2){

   IF (CS) THEN  KS END IF

}



CS{

FloorSlab.area> 500 m2 

   Building.usage="CulturalAndAssemblyFacility"

   OR Building.usage="ReligiousFacility" 

   OR  Building.usage="MedicalFacility" 

   OR Building.usage="AmusementFacility" 

   OR Building.usage="FuneralParlor"  

}



KS{

  Passage.effectiveWidth> 3m ;

} 








target_bldg_uses_01 = ['단독주택']
target_bldg_uses_02 = ['문화 및 집회시설', '장례시설', '의료시설', '위락시설']

target_bldg_uses_01_label = '건축물 용도1'
target_bldg_uses_02_label = '건축물 용도2'

def Check():
    for building in SELECT('building'):
        bldg_use = building.SELECT('building type').STRING()
        min_corridor_w = 1.5
        min_area = 0.0

        if bldg_use in target_bldg_uses_01:
            min_corridor_w = 0.9
        elif bldg_use in target_bldg_uses_02:
            min_corridor_w = 3.0
            min_area = 500

        if min_area > 0:
            area = 0
            for space in building.SELECT('space'):
                area += space.SELECT('area').UNIT('m2').NUMBER()
            if area < min_area:
                building.SUCCESS('바닥면적의 합: ' + str(area) + ' < ' + str(min_area))
                continue

        base_storey = None
        stories = building.SELECT('storey')

        for storey in stories:
            if storey.SELECT('prop', '기준 지상층').BOOL() == True:
                base_storey = storey
                break

        if base_storey is None:
            building.ERROR('기준 지상층이 존재하지 않습니다.')
            break

        stairs = base_storey.SELECT('direct stair')

        if stairs.COUNT() == 0:
            base_storey.ERROR(base_storey.SELECT('name').STRING() + '에 직통계단이 존재하지 않습니다.')
            continue

        exDoors = []
        for door in base_storey.SELECT('door'):
            if door.SELECT('is external').BOOL() == True:
                exDoors.append(door)

        for stair in stairs:
            for route in stair.SELECT('escape route', exDoors):
                for space in route.SELECT('passing space'):
                    width = space.SELECT('min clear width').UNIT('m')
                    w = width.NUMBER()
                    if w < min_corridor_w:
                        width.ERROR('통로 너비: ' + str(w) + ' < ' + str(min_corridor_w))
                    else:
                        width.SUCCESS('통로 너비: ' + str(w) + ' >= ' + str(min_corridor_w)) 





44
건축법 시행령 제 51조 2 항 1호 거 목

거. 장례시설





//건축법 시행령 51조 (거실의 채광 등) 2항 15호
Check(EDBA_51_2_15){
	getBuildingUsage() = "FuneralParlors"
}
 




Python Code 변환 예정



45
건축법 시행령 제 61조 1 항 6호

6. 문화 및 집회시설, 종교시설, 판매시설, 운수시설, 의료시설, 교육연구시설 중 학교(초등학교만 해당한다)·학원, 노유자시설, 수련시설, 업무시설 중 오피스텔, 숙박시설, 위락시설(단란주점 및 유흥주점은 제외한다), 장례시설, 「다중이용업소의 안전관리에 관한 특별법 시행령」 제2조에 따른 다중이용업(단란주점영업 및 유흥주점영업은 제외한다)의 용도로 쓰는 건축물





Check(EDBA_61_1_6){
KS}


KS{
(getBuildingUsage()="ClassIINeighborhoodLivingFacility.PerformanceHall"
OR getBuildingUsage()="ClassIINeighborhoodLivingFacility.BilliardRoom")
OR getBuildingUsage()="CulturalAndAssemblyFacility.WeddingHall"
OR getBuildingUsage()="EducationAndResearchFacility.ElementarySchool"
OR getBuildingUsage()="Trainingfacility"
OR (getBuildingUsage()="AmusementFacility.BarBusiness"
OR  getResult(ERSASP_2)= TRUE)
}
 




Python Code 변환 예정



46
건축법 시행령 제 8조 3 항 4호

4. 숙박시설





//건축법 시행령 8조 (건축허가) 3항 4호

Check(EDBA_8_3_4){
     KS
}
KS{
	getBuildingUsage() = "LodgingFacility"
} 








def Check():
    typ = SELECT('typology').STRING().lower()
    if typ == "LodgingFacility":
        building.SUCCESS("Building Usage is LodgingFacility")
    else:
        building.ERROR("Building Usage is not LodgingFacility") 
 





47
건축법 시행령 제 39조 1 항 7호

7. 교육연구시설 중 학교





// 건축법 시행령 39조 (건축물 바깥쪽으로의 출구 설치) 1항 7호

Check(EDBA_39_1_7){     
KS
}


KS {
Building myBuilding{
getBuildingUsage() = “Warehouse”
Building.grossFloorArea >= 5000 m2
}

isExist(myBuliding) = TRUE
}
 








target_bldg_type_1 = ['제2종 근린생활시설', '문화 및 집회시설', '종교시설', '판매시설', '업무시설', '창고시설', '교육연구시설', '장례시설', '승강기를 설치하여야하는 건축물']
target_bldg_sub_type_2 = ['판매시설']
max_route_length_stair_to_door = 30
max_route_length_space_to_door = 60
min_em_door_count = 2
min_em_door_h = 1.5
min_em_door_w = 0.75

target_bldg_types_1_label = '외부 출입구 방향 적용 대상 건출물 용도'
target_bldg_types_2_label = '외부 출입구 유효너비 대상 건출물 용도'

max_route_length_stair_to_door_label = '직통계단과 외부 출입구 간 최소거리'
max_route_length_space_to_door_label = '거실과 외부 출입구 간 최소거리'
min_em_door_count_label = '최소 비상구 개수'
min_em_door_h_label = '최소 비상구 높이'
min_em_door_w_label = '최소 비상구 유효너비'

def Check():
    for building in SELECT('building'):
        bldg_type = building.SELECT('building type').STRING()
        sub_type = building.SELECT('prop', '세부용도').STRING()
        if (bldg_type in target_bldg_type_1):
            if bldg_type == '제2종 근린생활시설' and sub_type in ['공연장', '종교집회장', '인터넷컴퓨터게임시설제공업소']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '문화 및 집회시설' and sub_type in ['전시장', '동물원', '식물원']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '업무시설' and sub_type == '청사':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '교육연구시설' and sub_type == '학교':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            message =  '검토 대상 건물입니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)

        else:
            message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)
            break



        evac_storey_exist = False
        stories = building.SELECT('storey')

        for storey in stories:
            if storey.SELECT('is evacuation storey').BOOL() == True:
                evac_storey_exist = True
                break

        if evac_storey_exist == False:
            ERROR('피난층이 존재하지 않습니다.')
            return

        for storey in stories:
            stairs = storey.SELECT('direct stair')

            if stairs.COUNT() == 0:
                storey.ERROR(storey.SELECT('name').STRING() + '에 직통계단이 존재하지 않습니다.')
                continue

            exDoors = []
            for door in storey.SELECT('door'):
                if door.SELECT('is external').BOOL() == True:
                    exDoors.append(door)

            for stair in stairs:
                route_length = -1
                for route in stair.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_stair_to_door:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    stair.SUCCESS(stair.SELECT('name').STRING() + ' : ' + str(route_length))

            spaces = storey.SELECT('space')

            for space in spaces:
                route_length = -1
                for route in space.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_space_to_door:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    space.SUCCESS(space.SELECT('name').STRING() + ' : ' + str(route_length))

            if bldg_type in target_bldg_types_1:
                for door in exDoors:
                    if door.SELECT('is inward').BOOL():
                        door.ERROR('외부 출입구의 방향이 안여닫이입니다.')

                for space in spaces:
                    code = space.SELECT('class code').STRING()
                    if not code in theater_space_codes:
                        continue
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area < 300:
                        continue
                    emExits = []
                    for door in space.SELECT('space door'):
                        if door.SELECT('prop', '비상구').BOOL() or door.SELECT('prop', '보조출입구').BOOL():
                            emExits.append(door)
                    if len(emExits) < min_em_door_count:
                        space.ERROR('비상구(보조출입구) 개수:' + str(len(emExits)) + '(<' + str(min_em_door_count) + ')')
                        continue
                    em_exit_count = 0
                    for exit in emExits:
                        if exit.SELECT('clear opening').UNIT('m').NUMBER() >= min_em_door_w and exit.SELECT('height').UNIT('m').NUMBER() >= min_em_door_h:
                            em_exit_count += 1
                    if em_exit_count < min_em_door_count:
                        space.ERROR('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(<' + str(min_em_door_count) + ')')
                    else:
                        space.SUCCESS('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(>=' + str(min_em_door_count) + ')')

            if bldg_type in target_bldg_types_2:
                if storey.SELECT('is evacuation storey').BOOL() == False:
                    continue
                max_area = 0;
                for space in spaces:
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area > max_area:
                        max_area = area
                min_door_w = max_area / 100 * 0.6;

                for door in exDoors:
                    width = door.SELECT('clear opening').UNIT('m')
                    w = width.NUMBER()
                    if (w < min_door_w):
                        width.ERROR('출구 유효너비:' + str(w) + '(<' + str(min_door_w) + ')')
                    else:
                        width.SUCCESS('출구 유효너비:' + str(w) + '(>=' + str(min_door_w) + ')')
 





48
건축법 시행령 제 8조 3 항 2호

2. 제2종 근린생활시설(일반음식점만 해당한다)





//건축법 시행령 8조 (건축허가) 3항 2호

Check(EDBA_8_3_2){
     KS
}
KS{
	getBuildingUsage() = "ClassIINeighborhoodLivingFacility.Restaurant"
} 








def Check():
    typ = SELECT('typology').STRING().lower()
    if typ == "ClassIINeighborhoodLivingFacility.Restaurant":
        building.SUCCESS("Building Usage is Restaurant of ClassIINeighborhoodLivingFacility")
    else:
        building.ERROR("Building Usage is not Restaurant of ClassIINeighborhoodLivingFacility")  





49
건축법 시행령 제 8조 3 항 3호

3. 업무시설(일반업무시설만 해당한다)





//건축법 시행령 8조 (건축허가) 3항 3호

Check(EDBA_8_3_3){
     KS
}
KS{
	getBuildingUsage() = "BusinessFacility.GeneralBusinessFacility"
} 








def Check():
    typ = SELECT('typology').STRING().lower()
    if typ == "BusinessFacility.GeneralBusinessFacility":
        building.SUCCESS("Building Usage is GeneralBusinessFacility of BusinessFacility")
    else:
        building.ERROR("Building Usage is not GeneralBusinessFacility of BusinessFacility")  





50
건축법 시행령 제 35조 2 항

② 건축물(갓복도식 공동주택은 제외한다)의 11층(공동주택의 경우에는 16층) 이상인 층(바닥면적이 400제곱미터 미만인 층은 제외한다) 또는 지하 3층 이하인 층(바닥면적이 400제곱미터미만인 층은 제외한다)으로부터 피난층 또는 지상으로 통하는 직통계단은 제1항에도 불구하고 특별피난계단으로 설치하여야 한다. <개정 2008.10.29>





//건축법 시행령 35조 (피난계단의 설치) 2항
check(EDBA_35_2){
	IF (CS1 AND CS2) THEN KS
}

CS1{
	Building.usage != "MultiUnitHouse.SideCorridorTypeMultiUnitHouse"
}

CS2{
	Floor myFloor{
 		IF (Building.usage = "MultiUnitHouse“) 
			THEN getFloorNumber(Floor) >= 16
     		ELSE 		
			getFloorNumber(Floor) >= 11
     		ENDIF

 		OR getFloorNumber(Floor) < -3
		getFloorArea(Floor) >= 400m2
	}

	Stair myStair {
		(isAccessible(Stair, Floor.isEscape) = TRUE
		 OR isAccessible(Stair, Ground) = TRUE)
                        isObjectProperty(Stair.isDirect) = TRUE
	}

	hasObject(myFloor, myStair) = TRUE
}

KS{
	isObjectProperty(myStair.isSpecialEscape) = TRUE
}
 




Python Code 변환 예정



51
건축법 시행령 제 36조

제36조 (옥외 피난계단의 설치) 건축물의 3층 이상인 층(피난층은 제외한다)으로서 다음 각 호의 어느 하나에 해당하는 용도로 쓰는 층에는 제34조에 따른 직통계단 외에 그 층으로부터 지상으로 통하는 옥외피난계단을 따로 설치하여야 한다.





//건축법 시행령 36조 (옥외 피난계단의 설치)

Check(EDBA_36){
    IF CS THEN KS
}

CS{
   getBuildingStoriesCount()>=3
   getResult(EDBA_36_0_1)=True
   OR getResult(EDBA_36_0_2)=True
}

KS{
   Stair myStair1{
       isObjectProperty(Stair.isDirect)=True
   }
   
   Stair myStair2{
       isObjectProperty(Stair.isEscape)=True
       isAccessible(Stair, Ground)=True
   }
  
   isExist(myStair1)=True
   isExist(myStair2)=True
} 




Python Code 변환 예정



52
건축법 시행령 제 39조 1 항 1호

1. 문화 및 집회시설(전시장 및 동·식물원은 제외한다)





// 건축법 시행령 39조 (건축물 바깥쪽으로의 출구 설치) 1항 1호

Check(EDBA_39_1_1){     
KS}

KS {

Building myBuilding{
getBuildingUsage() = “PerformanceHall”
OR getBuildingUsage() = “ReligiousAssemblyFacility ”
OR getBuildingUsage() = “FacilityForProvidingInternetComputerGameService”
}

Space mySpace{
Space.usage = “PerformanceHall”
OR Space.usage = “ReligiousAssemblyFacility ”
OR Space.usage = “FacilityForProvidingInternetComputerGameService”
}

IF isExist(myBuilding) THEN mySpace.FloorSlab.area >= 300 m2

}
 








target_bldg_type_1 = ['제2종 근린생활시설', '문화 및 집회시설', '종교시설', '판매시설', '업무시설', '창고시설', '교육연구시설', '장례시설', '승강기를 설치하여야하는 건축물']
target_bldg_sub_type_2 = ['판매시설']
max_route_length_stair_to_door = 30
max_route_length_space_to_door = 60
min_em_door_count = 2
min_em_door_h = 1.5
min_em_door_w = 0.75

target_bldg_types_1_label = '외부 출입구 방향 적용 대상 건출물 용도'
target_bldg_types_2_label = '외부 출입구 유효너비 대상 건출물 용도'

max_route_length_stair_to_door_label = '직통계단과 외부 출입구 간 최소거리'
max_route_length_space_to_door_label = '거실과 외부 출입구 간 최소거리'
min_em_door_count_label = '최소 비상구 개수'
min_em_door_h_label = '최소 비상구 높이'
min_em_door_w_label = '최소 비상구 유효너비'

def Check():
    for building in SELECT('building'):
        bldg_type = building.SELECT('building type').STRING()
        sub_type = building.SELECT('prop', '세부용도').STRING()
        if (bldg_type in target_bldg_type_1):
            if bldg_type == '제2종 근린생활시설' and sub_type in ['공연장', '종교집회장', '인터넷컴퓨터게임시설제공업소']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '문화 및 집회시설' and sub_type in ['전시장', '동물원', '식물원']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '업무시설' and sub_type == '청사':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '교육연구시설' and sub_type == '학교':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            message =  '검토 대상 건물입니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)

        else:
            message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)
            break



        evac_storey_exist = False
        stories = building.SELECT('storey')

        for storey in stories:
            if storey.SELECT('is evacuation storey').BOOL() == True:
                evac_storey_exist = True
                break

        if evac_storey_exist == False:
            ERROR('피난층이 존재하지 않습니다.')
            return

        for storey in stories:
            stairs = storey.SELECT('direct stair')

            if stairs.COUNT() == 0:
                storey.ERROR(storey.SELECT('name').STRING() + '에 직통계단이 존재하지 않습니다.')
                continue

            exDoors = []
            for door in storey.SELECT('door'):
                if door.SELECT('is external').BOOL() == True:
                    exDoors.append(door)

            for stair in stairs:
                route_length = -1
                for route in stair.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_stair_to_door:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    stair.SUCCESS(stair.SELECT('name').STRING() + ' : ' + str(route_length))

            spaces = storey.SELECT('space')

            for space in spaces:
                route_length = -1
                for route in space.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_space_to_door:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    space.SUCCESS(space.SELECT('name').STRING() + ' : ' + str(route_length))

            if bldg_type in target_bldg_types_1:
                for door in exDoors:
                    if door.SELECT('is inward').BOOL():
                        door.ERROR('외부 출입구의 방향이 안여닫이입니다.')

                for space in spaces:
                    code = space.SELECT('class code').STRING()
                    if not code in theater_space_codes:
                        continue
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area < 300:
                        continue
                    emExits = []
                    for door in space.SELECT('space door'):
                        if door.SELECT('prop', '비상구').BOOL() or door.SELECT('prop', '보조출입구').BOOL():
                            emExits.append(door)
                    if len(emExits) < min_em_door_count:
                        space.ERROR('비상구(보조출입구) 개수:' + str(len(emExits)) + '(<' + str(min_em_door_count) + ')')
                        continue
                    em_exit_count = 0
                    for exit in emExits:
                        if exit.SELECT('clear opening').UNIT('m').NUMBER() >= min_em_door_w and exit.SELECT('height').UNIT('m').NUMBER() >= min_em_door_h:
                            em_exit_count += 1
                    if em_exit_count < min_em_door_count:
                        space.ERROR('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(<' + str(min_em_door_count) + ')')
                    else:
                        space.SUCCESS('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(>=' + str(min_em_door_count) + ')')

            if bldg_type in target_bldg_types_2:
                if storey.SELECT('is evacuation storey').BOOL() == False:
                    continue
                max_area = 0;
                for space in spaces:
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area > max_area:
                        max_area = area
                min_door_w = max_area / 100 * 0.6;

                for door in exDoors:
                    width = door.SELECT('clear opening').UNIT('m')
                    w = width.NUMBER()
                    if (w < min_door_w):
                        width.ERROR('출구 유효너비:' + str(w) + '(<' + str(min_door_w) + ')')
                    else:
                        width.SUCCESS('출구 유효너비:' + str(w) + '(>=' + str(min_door_w) + ')')
 





53
건축법 시행령 제 39조 1 항 2호

2. 종교시설





// 건축법 시행령 39조 (건축물 바깥쪽으로의 출구 설치) 1항 2호

Check(EDBA_39_1_2){     
KS
}

KS {

Building myBuilding{
getBuildingUsage() = “CulturalAndAssemblyFacility”
getBuildingUsage() != “ExhibitionHall”
getBuildingUsage() != “ZoologicalAndBotanicalGarden”
}

isExist(myBuliding) = TRUE

}
 








target_bldg_type_1 = ['제2종 근린생활시설', '문화 및 집회시설', '종교시설', '판매시설', '업무시설', '창고시설', '교육연구시설', '장례시설', '승강기를 설치하여야하는 건축물']
target_bldg_sub_type_2 = ['판매시설']
max_route_length_stair_to_door = 30
max_route_length_space_to_door = 60
min_em_door_count = 2
min_em_door_h = 1.5
min_em_door_w = 0.75

target_bldg_types_1_label = '외부 출입구 방향 적용 대상 건출물 용도'
target_bldg_types_2_label = '외부 출입구 유효너비 대상 건출물 용도'

max_route_length_stair_to_door_label = '직통계단과 외부 출입구 간 최소거리'
max_route_length_space_to_door_label = '거실과 외부 출입구 간 최소거리'
min_em_door_count_label = '최소 비상구 개수'
min_em_door_h_label = '최소 비상구 높이'
min_em_door_w_label = '최소 비상구 유효너비'

def Check():
    for building in SELECT('building'):
        bldg_type = building.SELECT('building type').STRING()
        sub_type = building.SELECT('prop', '세부용도').STRING()
        if (bldg_type in target_bldg_type_1):
            if bldg_type == '제2종 근린생활시설' and sub_type in ['공연장', '종교집회장', '인터넷컴퓨터게임시설제공업소']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '문화 및 집회시설' and sub_type in ['전시장', '동물원', '식물원']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '업무시설' and sub_type == '청사':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '교육연구시설' and sub_type == '학교':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            message =  '검토 대상 건물입니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)

        else:
            message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)
            break



        evac_storey_exist = False
        stories = building.SELECT('storey')

        for storey in stories:
            if storey.SELECT('is evacuation storey').BOOL() == True:
                evac_storey_exist = True
                break

        if evac_storey_exist == False:
            ERROR('피난층이 존재하지 않습니다.')
            return

        for storey in stories:
            stairs = storey.SELECT('direct stair')

            if stairs.COUNT() == 0:
                storey.ERROR(storey.SELECT('name').STRING() + '에 직통계단이 존재하지 않습니다.')
                continue

            exDoors = []
            for door in storey.SELECT('door'):
                if door.SELECT('is external').BOOL() == True:
                    exDoors.append(door)

            for stair in stairs:
                route_length = -1
                for route in stair.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_stair_to_door:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    stair.SUCCESS(stair.SELECT('name').STRING() + ' : ' + str(route_length))

            spaces = storey.SELECT('space')

            for space in spaces:
                route_length = -1
                for route in space.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_space_to_door:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    space.SUCCESS(space.SELECT('name').STRING() + ' : ' + str(route_length))

            if bldg_type in target_bldg_types_1:
                for door in exDoors:
                    if door.SELECT('is inward').BOOL():
                        door.ERROR('외부 출입구의 방향이 안여닫이입니다.')

                for space in spaces:
                    code = space.SELECT('class code').STRING()
                    if not code in theater_space_codes:
                        continue
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area < 300:
                        continue
                    emExits = []
                    for door in space.SELECT('space door'):
                        if door.SELECT('prop', '비상구').BOOL() or door.SELECT('prop', '보조출입구').BOOL():
                            emExits.append(door)
                    if len(emExits) < min_em_door_count:
                        space.ERROR('비상구(보조출입구) 개수:' + str(len(emExits)) + '(<' + str(min_em_door_count) + ')')
                        continue
                    em_exit_count = 0
                    for exit in emExits:
                        if exit.SELECT('clear opening').UNIT('m').NUMBER() >= min_em_door_w and exit.SELECT('height').UNIT('m').NUMBER() >= min_em_door_h:
                            em_exit_count += 1
                    if em_exit_count < min_em_door_count:
                        space.ERROR('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(<' + str(min_em_door_count) + ')')
                    else:
                        space.SUCCESS('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(>=' + str(min_em_door_count) + ')')

            if bldg_type in target_bldg_types_2:
                if storey.SELECT('is evacuation storey').BOOL() == False:
                    continue
                max_area = 0;
                for space in spaces:
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area > max_area:
                        max_area = area
                min_door_w = max_area / 100 * 0.6;

                for door in exDoors:
                    width = door.SELECT('clear opening').UNIT('m')
                    w = width.NUMBER()
                    if (w < min_door_w):
                        width.ERROR('출구 유효너비:' + str(w) + '(<' + str(min_door_w) + ')')
                    else:
                        width.SUCCESS('출구 유효너비:' + str(w) + '(>=' + str(min_door_w) + ')')
 





54
건축법 시행령 제 39조 1 항 3호

3. 판매시설





// 건축법 시행령 39조 (건축물 바깥쪽으로의 출구 설치) 1항 3호

Check(EDBA_39_1_3){     
KS
}

KS {
Building myBuilding{
getBuildingUsage() = “ReligiousFacility”
}

isExist(myBuliding) = TRUE
}
 








target_bldg_type_1 = ['제2종 근린생활시설', '문화 및 집회시설', '종교시설', '판매시설', '업무시설', '창고시설', '교육연구시설', '장례시설', '승강기를 설치하여야하는 건축물']
target_bldg_sub_type_2 = ['판매시설']
max_route_length_stair_to_door = 30
max_route_length_space_to_door = 60
min_em_door_count = 2
min_em_door_h = 1.5
min_em_door_w = 0.75

target_bldg_types_1_label = '외부 출입구 방향 적용 대상 건출물 용도'
target_bldg_types_2_label = '외부 출입구 유효너비 대상 건출물 용도'

max_route_length_stair_to_door_label = '직통계단과 외부 출입구 간 최소거리'
max_route_length_space_to_door_label = '거실과 외부 출입구 간 최소거리'
min_em_door_count_label = '최소 비상구 개수'
min_em_door_h_label = '최소 비상구 높이'
min_em_door_w_label = '최소 비상구 유효너비'

def Check():
    for building in SELECT('building'):
        bldg_type = building.SELECT('building type').STRING()
        sub_type = building.SELECT('prop', '세부용도').STRING()
        if (bldg_type in target_bldg_type_1):
            if bldg_type == '제2종 근린생활시설' and sub_type in ['공연장', '종교집회장', '인터넷컴퓨터게임시설제공업소']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '문화 및 집회시설' and sub_type in ['전시장', '동물원', '식물원']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '업무시설' and sub_type == '청사':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '교육연구시설' and sub_type == '학교':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            message =  '검토 대상 건물입니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)

        else:
            message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)
            break



        evac_storey_exist = False
        stories = building.SELECT('storey')

        for storey in stories:
            if storey.SELECT('is evacuation storey').BOOL() == True:
                evac_storey_exist = True
                break

        if evac_storey_exist == False:
            ERROR('피난층이 존재하지 않습니다.')
            return

        for storey in stories:
            stairs = storey.SELECT('direct stair')

            if stairs.COUNT() == 0:
                storey.ERROR(storey.SELECT('name').STRING() + '에 직통계단이 존재하지 않습니다.')
                continue

            exDoors = []
            for door in storey.SELECT('door'):
                if door.SELECT('is external').BOOL() == True:
                    exDoors.append(door)

            for stair in stairs:
                route_length = -1
                for route in stair.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_stair_to_door:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    stair.SUCCESS(stair.SELECT('name').STRING() + ' : ' + str(route_length))

            spaces = storey.SELECT('space')

            for space in spaces:
                route_length = -1
                for route in space.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_space_to_door:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    space.SUCCESS(space.SELECT('name').STRING() + ' : ' + str(route_length))

            if bldg_type in target_bldg_types_1:
                for door in exDoors:
                    if door.SELECT('is inward').BOOL():
                        door.ERROR('외부 출입구의 방향이 안여닫이입니다.')

                for space in spaces:
                    code = space.SELECT('class code').STRING()
                    if not code in theater_space_codes:
                        continue
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area < 300:
                        continue
                    emExits = []
                    for door in space.SELECT('space door'):
                        if door.SELECT('prop', '비상구').BOOL() or door.SELECT('prop', '보조출입구').BOOL():
                            emExits.append(door)
                    if len(emExits) < min_em_door_count:
                        space.ERROR('비상구(보조출입구) 개수:' + str(len(emExits)) + '(<' + str(min_em_door_count) + ')')
                        continue
                    em_exit_count = 0
                    for exit in emExits:
                        if exit.SELECT('clear opening').UNIT('m').NUMBER() >= min_em_door_w and exit.SELECT('height').UNIT('m').NUMBER() >= min_em_door_h:
                            em_exit_count += 1
                    if em_exit_count < min_em_door_count:
                        space.ERROR('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(<' + str(min_em_door_count) + ')')
                    else:
                        space.SUCCESS('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(>=' + str(min_em_door_count) + ')')

            if bldg_type in target_bldg_types_2:
                if storey.SELECT('is evacuation storey').BOOL() == False:
                    continue
                max_area = 0;
                for space in spaces:
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area > max_area:
                        max_area = area
                min_door_w = max_area / 100 * 0.6;

                for door in exDoors:
                    width = door.SELECT('clear opening').UNIT('m')
                    w = width.NUMBER()
                    if (w < min_door_w):
                        width.ERROR('출구 유효너비:' + str(w) + '(<' + str(min_door_w) + ')')
                    else:
                        width.SUCCESS('출구 유효너비:' + str(w) + '(>=' + str(min_door_w) + ')')
 





55
건축법 시행령 제 39조 1 항 4호

4. 업무시설 중 국가 또는 지방자치단체의 청사





// 건축법 시행령 39조 (건축물 바깥쪽으로의 출구 설치) 1항 4호

Check(EDBA_39_1_4){     
KS
}

KS {
Building myBuilding{
getBuildingUsage() = “CommercialFacility”
}

isExist(myBuliding) = TRUE
}
 








target_bldg_type_1 = ['제2종 근린생활시설', '문화 및 집회시설', '종교시설', '판매시설', '업무시설', '창고시설', '교육연구시설', '장례시설', '승강기를 설치하여야하는 건축물']
target_bldg_sub_type_2 = ['판매시설']
max_route_length_stair_to_door = 30
max_route_length_space_to_door = 60
min_em_door_count = 2
min_em_door_h = 1.5
min_em_door_w = 0.75

target_bldg_types_1_label = '외부 출입구 방향 적용 대상 건출물 용도'
target_bldg_types_2_label = '외부 출입구 유효너비 대상 건출물 용도'

max_route_length_stair_to_door_label = '직통계단과 외부 출입구 간 최소거리'
max_route_length_space_to_door_label = '거실과 외부 출입구 간 최소거리'
min_em_door_count_label = '최소 비상구 개수'
min_em_door_h_label = '최소 비상구 높이'
min_em_door_w_label = '최소 비상구 유효너비'

def Check():
    for building in SELECT('building'):
        bldg_type = building.SELECT('building type').STRING()
        sub_type = building.SELECT('prop', '세부용도').STRING()
        if (bldg_type in target_bldg_type_1):
            if bldg_type == '제2종 근린생활시설' and sub_type in ['공연장', '종교집회장', '인터넷컴퓨터게임시설제공업소']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '문화 및 집회시설' and sub_type in ['전시장', '동물원', '식물원']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '업무시설' and sub_type == '청사':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '교육연구시설' and sub_type == '학교':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            message =  '검토 대상 건물입니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)

        else:
            message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)
            break



        evac_storey_exist = False
        stories = building.SELECT('storey')

        for storey in stories:
            if storey.SELECT('is evacuation storey').BOOL() == True:
                evac_storey_exist = True
                break

        if evac_storey_exist == False:
            ERROR('피난층이 존재하지 않습니다.')
            return

        for storey in stories:
            stairs = storey.SELECT('direct stair')

            if stairs.COUNT() == 0:
                storey.ERROR(storey.SELECT('name').STRING() + '에 직통계단이 존재하지 않습니다.')
                continue

            exDoors = []
            for door in storey.SELECT('door'):
                if door.SELECT('is external').BOOL() == True:
                    exDoors.append(door)

            for stair in stairs:
                route_length = -1
                for route in stair.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_stair_to_door:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    stair.SUCCESS(stair.SELECT('name').STRING() + ' : ' + str(route_length))

            spaces = storey.SELECT('space')

            for space in spaces:
                route_length = -1
                for route in space.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_space_to_door:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    space.SUCCESS(space.SELECT('name').STRING() + ' : ' + str(route_length))

            if bldg_type in target_bldg_types_1:
                for door in exDoors:
                    if door.SELECT('is inward').BOOL():
                        door.ERROR('외부 출입구의 방향이 안여닫이입니다.')

                for space in spaces:
                    code = space.SELECT('class code').STRING()
                    if not code in theater_space_codes:
                        continue
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area < 300:
                        continue
                    emExits = []
                    for door in space.SELECT('space door'):
                        if door.SELECT('prop', '비상구').BOOL() or door.SELECT('prop', '보조출입구').BOOL():
                            emExits.append(door)
                    if len(emExits) < min_em_door_count:
                        space.ERROR('비상구(보조출입구) 개수:' + str(len(emExits)) + '(<' + str(min_em_door_count) + ')')
                        continue
                    em_exit_count = 0
                    for exit in emExits:
                        if exit.SELECT('clear opening').UNIT('m').NUMBER() >= min_em_door_w and exit.SELECT('height').UNIT('m').NUMBER() >= min_em_door_h:
                            em_exit_count += 1
                    if em_exit_count < min_em_door_count:
                        space.ERROR('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(<' + str(min_em_door_count) + ')')
                    else:
                        space.SUCCESS('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(>=' + str(min_em_door_count) + ')')

            if bldg_type in target_bldg_types_2:
                if storey.SELECT('is evacuation storey').BOOL() == False:
                    continue
                max_area = 0;
                for space in spaces:
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area > max_area:
                        max_area = area
                min_door_w = max_area / 100 * 0.6;

                for door in exDoors:
                    width = door.SELECT('clear opening').UNIT('m')
                    w = width.NUMBER()
                    if (w < min_door_w):
                        width.ERROR('출구 유효너비:' + str(w) + '(<' + str(min_door_w) + ')')
                    else:
                        width.SUCCESS('출구 유효너비:' + str(w) + '(>=' + str(min_door_w) + ')')
 





56
건축법 시행령 제 39조 1 항 6호

6. 연면적이 5천 제곱미터 이상인 창고시설





// 건축법 시행령 39조 (건축물 바깥쪽으로의 출구 설치) 1항 6호

Check(EDBA_39_1_6){     
KS
}


KS {
Building myBuilding{
getBuildingUsage() = “AmusementFacility”
}

isExist(myBuliding) = TRUE
}
 








target_bldg_type_1 = ['제2종 근린생활시설', '문화 및 집회시설', '종교시설', '판매시설', '업무시설', '창고시설', '교육연구시설', '장례시설', '승강기를 설치하여야하는 건축물']
target_bldg_sub_type_2 = ['판매시설']
max_route_length_stair_to_door = 30
max_route_length_space_to_door = 60
min_em_door_count = 2
min_em_door_h = 1.5
min_em_door_w = 0.75

target_bldg_types_1_label = '외부 출입구 방향 적용 대상 건출물 용도'
target_bldg_types_2_label = '외부 출입구 유효너비 대상 건출물 용도'

max_route_length_stair_to_door_label = '직통계단과 외부 출입구 간 최소거리'
max_route_length_space_to_door_label = '거실과 외부 출입구 간 최소거리'
min_em_door_count_label = '최소 비상구 개수'
min_em_door_h_label = '최소 비상구 높이'
min_em_door_w_label = '최소 비상구 유효너비'

def Check():
    for building in SELECT('building'):
        bldg_type = building.SELECT('building type').STRING()
        sub_type = building.SELECT('prop', '세부용도').STRING()
        if (bldg_type in target_bldg_type_1):
            if bldg_type == '제2종 근린생활시설' and sub_type in ['공연장', '종교집회장', '인터넷컴퓨터게임시설제공업소']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '문화 및 집회시설' and sub_type in ['전시장', '동물원', '식물원']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '업무시설' and sub_type == '청사':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '교육연구시설' and sub_type == '학교':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            message =  '검토 대상 건물입니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)

        else:
            message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)
            break



        evac_storey_exist = False
        stories = building.SELECT('storey')

        for storey in stories:
            if storey.SELECT('is evacuation storey').BOOL() == True:
                evac_storey_exist = True
                break

        if evac_storey_exist == False:
            ERROR('피난층이 존재하지 않습니다.')
            return

        for storey in stories:
            stairs = storey.SELECT('direct stair')

            if stairs.COUNT() == 0:
                storey.ERROR(storey.SELECT('name').STRING() + '에 직통계단이 존재하지 않습니다.')
                continue

            exDoors = []
            for door in storey.SELECT('door'):
                if door.SELECT('is external').BOOL() == True:
                    exDoors.append(door)

            for stair in stairs:
                route_length = -1
                for route in stair.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_stair_to_door:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    stair.SUCCESS(stair.SELECT('name').STRING() + ' : ' + str(route_length))

            spaces = storey.SELECT('space')

            for space in spaces:
                route_length = -1
                for route in space.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_space_to_door:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    space.SUCCESS(space.SELECT('name').STRING() + ' : ' + str(route_length))

            if bldg_type in target_bldg_types_1:
                for door in exDoors:
                    if door.SELECT('is inward').BOOL():
                        door.ERROR('외부 출입구의 방향이 안여닫이입니다.')

                for space in spaces:
                    code = space.SELECT('class code').STRING()
                    if not code in theater_space_codes:
                        continue
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area < 300:
                        continue
                    emExits = []
                    for door in space.SELECT('space door'):
                        if door.SELECT('prop', '비상구').BOOL() or door.SELECT('prop', '보조출입구').BOOL():
                            emExits.append(door)
                    if len(emExits) < min_em_door_count:
                        space.ERROR('비상구(보조출입구) 개수:' + str(len(emExits)) + '(<' + str(min_em_door_count) + ')')
                        continue
                    em_exit_count = 0
                    for exit in emExits:
                        if exit.SELECT('clear opening').UNIT('m').NUMBER() >= min_em_door_w and exit.SELECT('height').UNIT('m').NUMBER() >= min_em_door_h:
                            em_exit_count += 1
                    if em_exit_count < min_em_door_count:
                        space.ERROR('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(<' + str(min_em_door_count) + ')')
                    else:
                        space.SUCCESS('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(>=' + str(min_em_door_count) + ')')

            if bldg_type in target_bldg_types_2:
                if storey.SELECT('is evacuation storey').BOOL() == False:
                    continue
                max_area = 0;
                for space in spaces:
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area > max_area:
                        max_area = area
                min_door_w = max_area / 100 * 0.6;

                for door in exDoors:
                    width = door.SELECT('clear opening').UNIT('m')
                    w = width.NUMBER()
                    if (w < min_door_w):
                        width.ERROR('출구 유효너비:' + str(w) + '(<' + str(min_door_w) + ')')
                    else:
                        width.SUCCESS('출구 유효너비:' + str(w) + '(>=' + str(min_door_w) + ')')
 





57
건축법 시행령 제 39조 1 항 8호

8. 장례식장





// 건축법 시행령 39조 (건축물 바깥쪽으로의 출구 설치) 1항 8호



Check(EDBA_39_1_8){
 

KS


}







KS {

Building myBuilding{

getBuildingUsage() = “EducationAndResearchFacility.School”

}



isExist(myBuliding) = TRUE

} 








target_bldg_type_1 = ['제2종 근린생활시설', '문화 및 집회시설', '종교시설', '판매시설', '업무시설', '창고시설', '교육연구시설', '장례시설', '승강기를 설치하여야하는 건축물']
target_bldg_sub_type_2 = ['판매시설']
max_route_length_stair_to_door = 30
max_route_length_space_to_door = 60
min_em_door_count = 2
min_em_door_h = 1.5
min_em_door_w = 0.75

target_bldg_types_1_label = '외부 출입구 방향 적용 대상 건출물 용도'
target_bldg_types_2_label = '외부 출입구 유효너비 대상 건출물 용도'

max_route_length_stair_to_door_label = '직통계단과 외부 출입구 간 최소거리'
max_route_length_space_to_door_label = '거실과 외부 출입구 간 최소거리'
min_em_door_count_label = '최소 비상구 개수'
min_em_door_h_label = '최소 비상구 높이'
min_em_door_w_label = '최소 비상구 유효너비'

def Check():
    for building in SELECT('building'):
        bldg_type = building.SELECT('building type').STRING()
        sub_type = building.SELECT('prop', '세부용도').STRING()
        if (bldg_type in target_bldg_type_1):
            if bldg_type == '제2종 근린생활시설' and sub_type in ['공연장', '종교집회장', '인터넷컴퓨터게임시설제공업소']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '문화 및 집회시설' and sub_type in ['전시장', '동물원', '식물원']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '업무시설' and sub_type == '청사':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '교육연구시설' and sub_type == '학교':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            message =  '검토 대상 건물입니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)

        else:
            message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)
            break



        evac_storey_exist = False
        stories = building.SELECT('storey')

        for storey in stories:
            if storey.SELECT('is evacuation storey').BOOL() == True:
                evac_storey_exist = True
                break

        if evac_storey_exist == False:
            ERROR('피난층이 존재하지 않습니다.')
            return

        for storey in stories:
            stairs = storey.SELECT('direct stair')

            if stairs.COUNT() == 0:
                storey.ERROR(storey.SELECT('name').STRING() + '에 직통계단이 존재하지 않습니다.')
                continue

            exDoors = []
            for door in storey.SELECT('door'):
                if door.SELECT('is external').BOOL() == True:
                    exDoors.append(door)

            for stair in stairs:
                route_length = -1
                for route in stair.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_stair_to_door:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    stair.SUCCESS(stair.SELECT('name').STRING() + ' : ' + str(route_length))

            spaces = storey.SELECT('space')

            for space in spaces:
                route_length = -1
                for route in space.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_space_to_door:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    space.SUCCESS(space.SELECT('name').STRING() + ' : ' + str(route_length))

            if bldg_type in target_bldg_types_1:
                for door in exDoors:
                    if door.SELECT('is inward').BOOL():
                        door.ERROR('외부 출입구의 방향이 안여닫이입니다.')

                for space in spaces:
                    code = space.SELECT('class code').STRING()
                    if not code in theater_space_codes:
                        continue
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area < 300:
                        continue
                    emExits = []
                    for door in space.SELECT('space door'):
                        if door.SELECT('prop', '비상구').BOOL() or door.SELECT('prop', '보조출입구').BOOL():
                            emExits.append(door)
                    if len(emExits) < min_em_door_count:
                        space.ERROR('비상구(보조출입구) 개수:' + str(len(emExits)) + '(<' + str(min_em_door_count) + ')')
                        continue
                    em_exit_count = 0
                    for exit in emExits:
                        if exit.SELECT('clear opening').UNIT('m').NUMBER() >= min_em_door_w and exit.SELECT('height').UNIT('m').NUMBER() >= min_em_door_h:
                            em_exit_count += 1
                    if em_exit_count < min_em_door_count:
                        space.ERROR('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(<' + str(min_em_door_count) + ')')
                    else:
                        space.SUCCESS('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(>=' + str(min_em_door_count) + ')')

            if bldg_type in target_bldg_types_2:
                if storey.SELECT('is evacuation storey').BOOL() == False:
                    continue
                max_area = 0;
                for space in spaces:
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area > max_area:
                        max_area = area
                min_door_w = max_area / 100 * 0.6;

                for door in exDoors:
                    width = door.SELECT('clear opening').UNIT('m')
                    w = width.NUMBER()
                    if (w < min_door_w):
                        width.ERROR('출구 유효너비:' + str(w) + '(<' + str(min_door_w) + ')')
                    else:
                        width.SUCCESS('출구 유효너비:' + str(w) + '(>=' + str(min_door_w) + ')')
 





58
건축법 시행령 제 39조 1 항 9호

9. 승강기를 설치하여야 하는 건축물





// 건축법 시행령 39조 (건축물 바깥쪽으로의 출구 설치) 1항 9호

Check(EDBA_39_1_9){     
KS}

KS {
Building myBuilding{
getBuildingUsage() = “FuneralParlor”
}

isExist(myBuliding) = TRUE
}


 








target_bldg_type_1 = ['제2종 근린생활시설', '문화 및 집회시설', '종교시설', '판매시설', '업무시설', '창고시설', '교육연구시설', '장례시설', '승강기를 설치하여야하는 건축물']
target_bldg_sub_type_2 = ['판매시설']
max_route_length_stair_to_door = 30
max_route_length_space_to_door = 60
min_em_door_count = 2
min_em_door_h = 1.5
min_em_door_w = 0.75

target_bldg_types_1_label = '외부 출입구 방향 적용 대상 건출물 용도'
target_bldg_types_2_label = '외부 출입구 유효너비 대상 건출물 용도'

max_route_length_stair_to_door_label = '직통계단과 외부 출입구 간 최소거리'
max_route_length_space_to_door_label = '거실과 외부 출입구 간 최소거리'
min_em_door_count_label = '최소 비상구 개수'
min_em_door_h_label = '최소 비상구 높이'
min_em_door_w_label = '최소 비상구 유효너비'

def Check():
    for building in SELECT('building'):
        bldg_type = building.SELECT('building type').STRING()
        sub_type = building.SELECT('prop', '세부용도').STRING()
        if (bldg_type in target_bldg_type_1):
            if bldg_type == '제2종 근린생활시설' and sub_type in ['공연장', '종교집회장', '인터넷컴퓨터게임시설제공업소']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '문화 및 집회시설' and sub_type in ['전시장', '동물원', '식물원']:
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '업무시설' and sub_type == '청사':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            elif bldg_type == '교육연구시설' and sub_type == '학교':
                message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
                SUCCESS(message)
                break
            message =  '검토 대상 건물입니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)

        else:
            message =  '검토 대상 건물이 아닙니다.' + '(용도:' + bldg_type + ', 세부용도:' + sub_type + ' )'
            SUCCESS(message)
            break



        evac_storey_exist = False
        stories = building.SELECT('storey')

        for storey in stories:
            if storey.SELECT('is evacuation storey').BOOL() == True:
                evac_storey_exist = True
                break

        if evac_storey_exist == False:
            ERROR('피난층이 존재하지 않습니다.')
            return

        for storey in stories:
            stairs = storey.SELECT('direct stair')

            if stairs.COUNT() == 0:
                storey.ERROR(storey.SELECT('name').STRING() + '에 직통계단이 존재하지 않습니다.')
                continue

            exDoors = []
            for door in storey.SELECT('door'):
                if door.SELECT('is external').BOOL() == True:
                    exDoors.append(door)

            for stair in stairs:
                route_length = -1
                for route in stair.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_stair_to_door:
                    stair.ERROR(stair.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    stair.SUCCESS(stair.SELECT('name').STRING() + ' : ' + str(route_length))

            spaces = storey.SELECT('space')

            for space in spaces:
                route_length = -1
                for route in space.SELECT('escape route', exDoors):
                    length = route.SELECT('length').UNIT('m').NUMBER()
                    if length > 0:
                        if route_length < 0:
                            route_length = length
                        else:
                            route_length = min([route_length, length])
                if route_length < 0:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지 갈 수 없다.')
                elif route_length > max_route_length_space_to_door:
                    space.ERROR(space.SELECT('name').STRING() + '부터 외부 출입구까지의 거리가 멀다 : ' + str(route_length))
                else:
                    space.SUCCESS(space.SELECT('name').STRING() + ' : ' + str(route_length))

            if bldg_type in target_bldg_types_1:
                for door in exDoors:
                    if door.SELECT('is inward').BOOL():
                        door.ERROR('외부 출입구의 방향이 안여닫이입니다.')

                for space in spaces:
                    code = space.SELECT('class code').STRING()
                    if not code in theater_space_codes:
                        continue
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area < 300:
                        continue
                    emExits = []
                    for door in space.SELECT('space door'):
                        if door.SELECT('prop', '비상구').BOOL() or door.SELECT('prop', '보조출입구').BOOL():
                            emExits.append(door)
                    if len(emExits) < min_em_door_count:
                        space.ERROR('비상구(보조출입구) 개수:' + str(len(emExits)) + '(<' + str(min_em_door_count) + ')')
                        continue
                    em_exit_count = 0
                    for exit in emExits:
                        if exit.SELECT('clear opening').UNIT('m').NUMBER() >= min_em_door_w and exit.SELECT('height').UNIT('m').NUMBER() >= min_em_door_h:
                            em_exit_count += 1
                    if em_exit_count < min_em_door_count:
                        space.ERROR('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(<' + str(min_em_door_count) + ')')
                    else:
                        space.SUCCESS('기준(' + str(min_em_door_w) + 'X' + str(min_em_door_h) + ')을 충족하는 비상구(보조출입구) 개수:' + str(em_exit_count) + '(>=' + str(min_em_door_count) + ')')

            if bldg_type in target_bldg_types_2:
                if storey.SELECT('is evacuation storey').BOOL() == False:
                    continue
                max_area = 0;
                for space in spaces:
                    area = space.SELECT('area').UNIT('m2').NUMBER()
                    if area > max_area:
                        max_area = area
                min_door_w = max_area / 100 * 0.6;

                for door in exDoors:
                    width = door.SELECT('clear opening').UNIT('m')
                    w = width.NUMBER()
                    if (w < min_door_w):
                        width.ERROR('출구 유효너비:' + str(w) + '(<' + str(min_door_w) + ')')
                    else:
                        width.SUCCESS('출구 유효너비:' + str(w) + '(>=' + str(min_door_w) + ')')
 





59
건축법 시행령 제 44조

제44조 (피난 규정의 적용례) 건축물이 창문, 출입구, 그 밖의 개구부(開口部)(이하 "창문등"이라 한다)가 없는 내화구조의 바닥 또는 벽으로 구획되어 있는 경우에는 그 구획된 각 부분을 각각 별개의 건축물로 보아 제34조부터 제41조까지를 적용한다.





//건축법 시행령 44조 (피난 규정의 적용례)



Check(EDBA_44){

   IF CS THEN KS

}



CS{

   Door myDoor{

      isObjectProperty(Door.isEntrance)=True

   }



   Object  myElement {

        getObject(Window)

        getObject(Opening)

        getObject(myDoor)

   }

   

   FloorSlab myFloorSlab{



        getObjectProperty(FloorSlab.isFireResistantStructure)=True

   }



     Wall myWall{

        getObjectProperty(FloorSlab.isFireResistantStructure)=True

        hasObject(Wall, myElement) =False

   }



   isFirePartition(Building, myFloorSlab)=True

   OR  isFirePartition(Building, myWall)=True

   



}



KS{

   getResult(EDBA_34)=True

   getResult(EDBA_35)=True

   getResult(EDBA_36)=True

   getResult(EDBA_37)=True

   getResult(EDBA_38)=True

   getResult(EDBA_39)=True

   getResult(EDBA_40)=True

   getResult(EDBA_41)=True

} 




Python Code 변환 예정



60
건축법 시행령 제 46조 1 항

① 법 제49조제2항에 따라 주요구조부가 내화구조 또는 불연재료로 된 건축물로서 연면적이 1천 제곱미터를 넘는 것은 국토해양부령으로 정하는 기준에 따라 내화구조로 된 바닥·벽 및 제64조에 따른 갑종 방화문(국토해양부장관이 정하는 기준에 적합한 자동방화셔텨를 포함한다. 이하 이 조에서 같다)으로 구획(이하 "방화구획"이라 한다)하여야 한다. 다만, 「원자력법」 제2조에 따른 원자로 및 관계시설은 「원자력법」에서 정하는 바에 따른다.





//건축법 시행령 46조 (방화구획의 설치) 1항

Check(EDBA_46_1){

   IF (!CS1 AND CS2) THEN KS

}





CS1{

  getBuildingUsage()="NuclearReactorAndRelatedFacility"

}



CS2{

  (isObjectProperty(MainStructuralPart.isFireResistantStructure)=TRUE

  OR isObjectProperty(MainStructuralPart.Material.nonCombustibility)=TRUE))

  AND Building.grossFloorArea>1000 m2

}



KS{



  Floor myFloor{

      isObjectProperty(FloorSlab.isFireResistantStructure)=TRUE

  }

  Wall myWall{

      isObjectProperty(Wall.isFireResistantStructure)=TRUE

  }

  Door myDoor{

      isObjectProperty(Door.isStrictFireproofDoor)=TRUE

  }



  isFirePartition(Building, myFloor)=TRUE

  AND  isFirePartition(Building, myWall)=TRUE

  AND  isFirePatrition(Building, myDoor)=TRUE



  AND getResult(REFB_14_1)=TRUE

  AND getResult(REFB_14_2)=TRUE

  AND getResult(REFB_14_3)=TRUE



} 




Python Code 변환 예정



61
건축법 시행령 제 46조 2 항 5호

5. 복층형 공동주택의 세대별 층간 바닥 부분





//건축법 시행령 46조 (방화구획의 설치) 2항 5호
check(EDBA_46_2_5){
	Zone myZone{
		isObjectProperty(Zone.isOccupiedByOneHousehold) = TRUE
	}
	getBuildingUsage() = "DuplexMultiUnitHouses"
	hasSpace(myZone, Floor) = TRUE
	getFloorNumber(Floor) != 1
} 




Python Code 변환 예정



62
건축법 시행령 제 46조 2 항 7호

7. 단독주택, 동물 및 식물 관련 시설 또는 교정 및 군사시설 중 군사시설(집회, 체육, 창고 등의 용도로 사용되는 시설만 해당한다)로 쓰는 건축물





//건축법 시행령 46조 (방화구획의 설치) 2항 7호

check(EDBA_46_2_7){

KS

}



KS{

getBuildingUsage()="DetachedHouses"

OR getBuildingUsage()="FacilitiesForAnimalsAndPlants"

OR (getBuildingUsage()="CorrectionalFacilityANDMilitaryFacilities" and (getSpaceUsage()= "Assembly" OR "Gymnasium" OR "Warehouses")

} 




Python Code 변환 예정



63
건축법 시행령 제 46조 4 항

④ 공동주택 중 아파트로서 4층 이상인 층의 각 세대가 2개 이상의 직통계단을 사용할 수 없는 경우에는 발코니에 인접 세대와 공동으로 또는 각 세대별로 다음 각 호의 요건을 모두 갖춘 대피공간을 하나 이상 설치하여야 한다. 이 경우 인접 세대와 공동으로 설치하는 대피공간은 인접 세대를 통하여 2개 이상의 직통계단을 쓸 수 있는 위치에 우선 설치되어야 한다.





//건축법 시행령 46조 (방화구획의 설치) 4항

check(EDBA_46_4){

IF CS THEN KS1 AND KS2

}



Zone myZone{

     isObjectProperty(Zone.isOccupiedByOneHousehold) = TRUE

}



KS1{
Space mySpace{
Space.isEscape = TRUE
}

isExist(Balcony)=TRUE

AND hasElement(Balcony,mySpace)=TRUE

AND (getResult(EDBA_46_4_1)=TRUE

AND getResult(EDBA_46_4_2)=TRUE

AND getResult(EDBA_46_4_3)=TRUE

AND getResult(EDBA_46_4_4)=TRUE)

}



KS2{
Stair myStair{
Stair.isDirect = TRUE
}

isGoThrough(myZone,mySpace,myZone)=TRUE

AND isGoThrough(mySpace,myZone,myStair)=TRUE

}



CS{

getBuildingUsage()="MultiUnitHouses.ApartmentHouses"

AND Floor.number >=4

AND isDirectlyAccessible(myZone, myStair)=TRUE

AND myStair.Number>=2

} 




Python Code 변환 예정



64
건축법 시행령 제 46조 5 항

⑤ 제4항에도 불구하고 아파트의 4층 이상인 층에서 발코니에 설치하는 인접 세대와의 경계벽이 파괴하기 쉬운 경량구조 등이거나 경계벽에 피난구를 설치한 경우에는 대피공간을 설치하지 아니할 수 있다.





//건축법 시행령 46조 (방화구획의 설치) 5항

Check(EDBA_5){

CS 

}

Space mySpace{
Space.isEscape = TRUE
}

CS{getObjectProperty(Building.usage)="ApartmentHouses"
  AND isExist(Balcony)=TRUE

  AND (hasObject(Balcony,Structure)=TRUE

  AND (getResult(EDBA_5_1)=TRUE

  or getResult(EDBA_5_2)=TRUE

  or getResult(EDBA_5_3)=TRUE)

  AND isExist(mySpace)=FALSE

} 




Python Code 변환 예정



65
건축법 시행령 제 50조

제50조 (거실반자의 설치) 법 제49조제2항에 따라 공장, 창고시설, 위험물저장 및 처리시설, 동물 및 식물 관련 시설, 분뇨 및 쓰레기처리시설 또는 묘지 관련시설 외의 용도로 쓰는 건축물 거실의 반자(반자가 없는 경우에는 보 또는 바로 위층의 바닥판의 밑면, 그 밖에 이와 비슷한 것을 말한다)는 국토해양부령으로 정하는 기준에 적합하여야 한다.





// 건축법 시행령 50조 (거실반자의 설치)
check(EDBA_50){
	IF (CS) THEN KS
}

CS{
	Building.usage != "Factory"
	OR Building.usage != "Warehouse"
	OR Building.usage != "FacilityForStorageAndTreatmentOfDangerousSubstance"
	OR Building.usage != "FacilityForAnimalAndPlant"
	OR Building.usage != "ResourceRecyclingFacility"
	OR Building.usage != "CemeteryAndRelatedFacility"
}

KS{
	getResult(REFB_16_1) = TRUE
	getResult(REFB_16_2) = TRUE
}
 








min_h = 2.1
min_h_label = '최소 반자 높이'

def Check():
    for space in SELECT('space'):
        dist = space.SELECT('ceiling height')
        height = dist.UNIT('m').NUMBER()
        if height < min_h:
            dist.ERROR('반자 높이 : ' + str(height) + ' < ' + str(min_h))
        else:
            dist.SUCCESS('반자 높이 : ' + str(height) + ' >= ' + str(min_h)) 





66
건축법 시행령 제 51조 1 항

① 법 제49조제2항에 따라 단독주택 및 공동주택의 거실, 교육연구시설 중 학교의 교실, 의료시설의 병실 및 숙박시설의 객실에는 국토해양부령으로 정하는 기준에 따라 채광 및 환기를 위한 창문등이나 설비를 설치하여야 한다.





// 건축법 시행령 51조 (거실의 채광 등) 1항
check(EDBA_51_1){
	IF CS THEN KS
}

CS{
	getBuildingUsage() = "DetachedHouse.Room"
	OR getBuildingUsage() = "MultiUnitHouse.Room"
	OR getBuildingUsage() = "School.Classroom"
	OR getBuildingUsage() = "MedicalFacility.Ward"
	OR getBuildingUsage() = "LodgingFacility.GuestRoom"
}

KS{
	hasElement(Window) = TRUE
} 








target_bldg_uses = ['단독주택', '공동주택', '교육연구시설', '의료시설', '숙박시설']
target_space_codes = ['33202', '34310', '33201', '34404', '34409']
min_light_win_area = 0.5
min_light_area_ratio = 0.1
min_vent_area_ratio = 0.05

target_bldg_uses_label = '대상 건축물 용도'
target_space_codes_label = '대상 공간분류코드'
min_light_win_area_label = '최소 채광창 면적'
min_light_area_ratio_label = '최소 채광창/바닥 면적비'
min_vent_area_ratio_label = '최소 환기창/바닥 면적비' 

def Check():
    for building in SELECT('building'):
        bldg_use = building.SELECT('building type').STRING()
        if not bldg_use in target_bldg_uses:
            continue
        if bldg_use == '교육연구시설':
            if building.SELECT('prop', '세부용도').STRING() != '학교':
                continue

        for space in building.SELECT('space'):
            code = space.SELECT('class code').STRING()
            if not code in target_space_codes:
                continue

            space_area = space.SELECT('area').UNIT('m2').NUMBER()
            light_area_sum = 0.0
            vent_area_sum = 0.0

            for window in space.SELECT('window'):
                area = window.SELECT('area-y').UNIT('m2').NUMBER()
                vent_ratio = window.SELECT('prop', '환기가능면적비').NUMBER()

                if area >= min_light_win_area:
                    light_area_sum += area
                if vent_ratio > 0:
                    vent_area_sum += area * vent_ratio / 100;

            if light_area_sum / space_area >= min_light_area_ratio:
                space.SUCCESS('채광면적(' + str(light_area_sum) + ') / 바닥면적(' + str(space_area) + ') >= ' + str(min_light_area_ratio))
            else:
                space.ERROR('채광면적(' + str(light_area_sum) + ') / 바닥면적(' + str(space_area) + ') < ' + str(min_light_area_ratio))

            if vent_area_sum / space_area >= min_vent_area_ratio:
                space.SUCCESS('환기면적(' + str(vent_area_sum) + ') / 바닥면적(' + str(space_area) + ') >= ' + str(min_vent_area_ratio))
            else:
                if space.SELECT('prop', '공기조화설비설치여부').BOOL() == True:
                    space.SUCCESS('공기조화설비 설치')
                else:
                    space.ERROR('환기면적(' + str(vent_area_sum) + ') / 바닥면적(' + str(space_area) + ') < ' + str(min_vent_area_ratio) + ', 공기조화설비 미설치') 





67
건축법 시행령 제 51조 2 항

② 법 제49조제2항에 따라 6층 이상인 건축물로서 문화 및 집회시설, 종교시설, 판매시설, 운수시설, 의료시설, 교육연구시설 중 연구소, 노유자시설 중 아동 관련 시설·노인복지시설, 수련시설 중 유스호스텔, 운동시설, 업무시설, 숙박시설, 위락시설, 관광휴게시설 및 장례식장의 거실에는 국토해양부령으로 정하는 기준에 따라 배연설비(排煙設備)를 하여야 한다. 다만, 피난층인 경우에는 그러하지 아니하다.





//건축법 시행령 51조 (거실의 채광 등) 2항
Check(EDBA_51_2){
	IF (!CS1 AND CS2) THEN KS
}


CS1{
	Floor myFloor{
		isObjectProperty(Floor.isEscape) = TRUE
	}
	getFloorNumber(Room) = getFloorNumber(myFloor)
}

CS2{
	getBuildingStoriesCount() >= 6
	getResult(EDBA_51_2_1) = True
	OR getResult(EDBA_51_2_2) = True
	OR getResult(EDBA_51_2_3) = True
	OR getResult(EDBA_51_2_4) = True
	OR getResult(EDBA_51_2_5) = True
	OR getResult(EDBA_51_2_6) = True
	OR getResult(EDBA_51_2_7) = True
	OR getResult(EDBA_51_2_8) = True
	OR getResult(EDBA_51_2_9) = True
	OR getResult(EDBA_51_2_10) = True
	OR getResult(EDBA_51_2_11) = True
	OR getResult(EDBA_51_2_12) = True
	OR getResult(EDBA_51_2_13) = True
	OR getResult(EDBA_51_2_14) = True
	OR getResult(EDBA_51_2_15) = True
}

KS{
	hasSpace(Room, SmokeExhaustionSystem) = True
	getResult(RFB_14_1) = True
	getResult(REFB_17_1) = True
	getResult(REFB_17_2) = True
}
 




Python Code 변환 예정



68
건축법 시행령 제 56조 1 항 1호

1. 문화 및 집회시설(전시장 및 동·식물원은 제외한다), 종교시설, 위락시설 중 주점영업 및 장례식장의 용도로 쓰는 건축물로서 관람석 또는 집회실의 바닥면적의 합계가 200제곱미터(옥외관람석의 경우에는 1천 제곱미터) 이상인 건축물





//건축법 시행령 56조 (건축물의 내화구조) 1항 1호

check(EDBA_56_1_1){

	KS

}


Space mySpace{
Space.usage = "Auditorium "
isExternal(Space) = TRUE
}



KS {

        (getBuildingUsage() = "PerformanceHall" | "ReligiousAssemblyFacility"

        AND getFloorArea(getSpace("PerformanceHall" | “ReligiousAssemblyFacility”)) > = 300m2;)

	

        OR (getBuildingUsage() = "CulturalAndAssemblyFacility" 

        AND getBuildingUsage() != "ExhibitionHall" | "ZoologicalAndBotanicalGarden"

        

        OR (getBuildingUsage() = "ReligiousFacility" | "BarBusiness" | "FuneralParlor"

	AND getFloorArea(getSpace(“Seat” | “AssemblyHall”) > = 200m2 

        OR getFloorArea(mySpace) > = 1000m2;)

} 




Python Code 변환 예정



69
건축법 시행령 제 56조 1 항 2호

2. 문화 및 집회시설 중 전시장 또는 동·식물원, 판매시설, 운수시설, 수련시설, 운동시설 중 체육관·운동장, 위락시설(주점영업의 용도로 쓰는 것은 제외한다), 창고시설, 위험물저장 및 처리시설, 자동차 관련 시설, 방송통신시설 중 방송국·전신전화국·촬영소, 묘지 관련 시설 중 화장장 또는 관광휴게시설의 용도로 쓰는 건축물로서 그 용도로 쓰는 바닥면적의 합계가 500제곱미터 이상인 건축물





//건축법 시행령 56조 (건축물의 내화구조) 1항 2호

check(EDBA_56_1_2){

        KS

}

	

KS{

        (getBuildingUsage() = "ExhibitionHall" |  "ZoologicalANDbotanicalGarden" | "CommercialFacility"  | "TransportationFacilities"  | "gymnasium.educationAndresearchFacilities"   | "hall.educationAndresearchFacilities" | "gymnasium" | "sportsfacilities.stadium" | "sports facilities.warehouses"  | "factory.facilitiesForStorageAndreatmentOfDangerousSubstance"  | "factory.facilitiesForMotorVehicles" | "facilitiesforbroadcastingAndTelecommunications.broadcastingStation"  | "facilitiesforbroadcasting andtelecommunications.telegraphAndTelephoneStations" | "facilitiesforbroadcasting and telecommunications.studio" | "cemeteries and relatedfacilities.Crematorium | "facilitiesfortourismandrelaxation"

OR (getBuildingUsage() = "amusementfacilities"

AND getBuildingUsage() != "barbusiness.amusementfacilities"))

AND getFloorArea(getSpace(getBuildingUsage()) > = 500m2))

} 




Python Code 변환 예정



70
건축법 시행령 제 57조 1 항

① 법 제50조제2항에 따라 연면적 1천 제곱미터 이상인 건축물은 방화벽으로 구획하되, 각 구획된 바닥면적의 합계는 1천 제곱미터 미만이어야 한다. 다만, 주요구조부가 내화구조이거나 불연재료인 건축물과 제56조제1항제5호 단서에 따른 건축물 또는 내부설비의 구조상 방화벽으로 구획할 수 없는 창고시설의 경우에는 그러하지 아니하다.





//  건축법 시행령 57조 (	대규모 건축물의 방화벽 등) 1항
Check(EDBA_57_1){
	IF (CS1 AND CS2) THEN KS
}

CS1{
	getObjectProperty(MainStructuralPart.isFireResistantStructure) = TRUE
	OR getObjectProperty(MainStructuralPart.Material.nonCombustibility) = TRUE
	OR getResult(EDBA_56_1_5) = TRUE
}

CS2{
	getObjectProperty(Building.grossFloorArea) >= 1000m2
}

KS{
	Space mySpace{
		getFloorArea(Space) < 1000m2
	}

	Space mySpace2{
		Space != mySpace
	}

	Wall myWall{
		isObjectProperty(Wall.isFireProofWall) = TRUE
	}

	isPartitioned(mySpace, mySpace2, myWall) = TRUE
} 




Python Code 변환 예정



71
건축법 시행령 제 57조 3 항

③ 연면적 1천 제곱미터 이상인 목조 건축물의 구조는 국토해양부령으로 정하는 바에 따라 방화구조로 하거나 불연재료로 하여야 한다.





//  건축법 시행령 57조 (대규모 건축물의 방화벽 등) 3항

Check(EDBA_57_3){

	IF CS THEN KS

}



CS{

	getObjectProperty(Building.grossFloorArea) >= 1000m2

	getObjectProperty(Building.Structure.materialType) = "Timber"

}



KS{

	getObjectProperty(MainStructuralPart.Material.nonCombustibility) = TRUE

	OR getObjectProperty(MainStructuralPart.isFireProofStructure) = TRUE

} 




Python Code 변환 예정



72
건축법 시행령 제 89조

제89조 (승용 승강기의 설치) 법 제64조제1항 전단에서 "대통령령으로 정하는 건축물"이란 층수가 6층인 건축물로서 각 층 거실의 바닥면적 300제곱미터 이내마다 1개소 이상의 직통계단을 설치한 건축물을 말한다.





//건축법 시행령 89조 (승용 승강기의 설치)
Check(EDBA_89){
     KS
}

KS{
     Stair myStair{
          isObjectProperty(Stair.isDirect) = TRUE
     }
     getBuildingStoriesCount() = 6
     isExist(myStair) = TRUE
} 




Python Code 변환 예정



73
건축법 시행령 제 90조 1 항

① 법 제64조제2항에 따라 높이 31미터를 넘는 건축물에는 다음 각 호의 기준에 따른 대수 이상의 비상용 승강기(비상용 승강기의 승강장 및 승강로를 포함한다. 이하 이 조에서 같다)를 설치하여야 한다. 다만, 법 제64조제1항에 따라 설치되는 승강기를 비상용 승강기의 구조로 하는 경우에는 그러하지 아니하다.





//건축법 시행령 90조 (비상용 승강기의 설치) 1항

Check(EDBA_90_1){
  IF (!CS1 AND CS2) THEN KS

}

CS1{
    getResult(BA_64_1)=TRUE
    isObjectProperty(Elevator.isEmergency)=TRUE
    
}

CS2{
    getBuildingHeight()>31 m
}

KS{
    getResult(EDBA_90_1_1)=TRUE
    getReslut(EDBA_90_1_2)=TRUE
} 




Python Code 변환 예정



74
건축법 시행령 제 56조 1 항

① 법 제50조제1항에 따라 다음 각 호의 어느 하나에 해당하는 건축물(제5호에 해당하는 건축물로서 2층 이하인 건축물은 지하층 부분만 해당한다)의 주요구조부는 내화구조로 하여야 한다. 다만, 연면적이 50제곱미터 이하인 단층의 부속건축물로서 외벽 및 처마 밑면을 방화구조로 한 것과 무대의 바닥은 그러하지 아니하다. <개정 2009.6.30>





//건축법 시행령 56조 (건축물의 내화구조) 1항

check(EDBA_56_1){

        IF !CS THEN KS

}

Space mySpace{
Space.usage="StagePart"
}

Floor myFloor{

     hasSpace(mySpace, Floor) = TRUE

}



CS {

       getTotalFloorArea()<= 50m2

       AND getBuildingStoriesCount()=1

       AND getBuildingUsage()="AccessoryBuidling"

       AND isFireProofStructure("OuterWall" | "eaves" | myFloor)=TRUE

}



KS {

	getResult(EDBA_56_1_1 = TRUE  

	OR getResult(EDBA_56_1_2) = TRUE  

	OR getResult(EDBA_56_1_3) = TRUE  

	OR getResult(EDBA_56_1_4) = TRUE  

	OR getResult(EDBA_56_1_5) = TRUE  

   		

	AND isFireProofStructure(MainStructuralPart) = TRUE

} 




Python Code 변환 예정



75
건축법 시행령 제 56조 1 항 5호

5. 3층 이상인 건축물 및 지하층이 있는 건축물. 다만, 단독주택(다중주택 및 다가구주택은 제외한다), 동물 및 식물 관련 시설, 발전시설(발전소의 부속용도로 쓰는 시설은 제외한다), 교도소·감화원 또는 묘지 관련 시설(화장장은 제외한다)의 용도로 쓰는 건축물과 철강 관련 업종의 공장 중 제어실로 사용하기 위하여 연면적 50제곱미터 이하로 증축하는 부분은 제외한다.





//건축법 시행령 56조 (건축물의 내화구조) 1항 5호

check(EDBA_56_1_5){

	IF !CS THEN KS

}

Building myBuilding{

     getBuildingUsage() = "PowerPlant"

     isObjectProperty(Building.isAttachedBuilding) = TRUE

}


Building  myBuilding{

     getResult(REFB_*_3_30) = TRUE

     getResult(REFB_*_3_31) = TRUE

}



CS{

         getBuildingUsage() = "facilities for animals and plants"

                                       

                              | "facilities for power generation"

                              | "correctional facilities and military installations.prison"

                              | "correctional facilities and military installations.reformatories 

                              | "myFactory"



	 OR (getBuildingUsage() = "detached houses"

             AND getBuildingUsage() != "detached houses.multi-user houses" 

                                     | "detached houses.multi-family houses" )



	 OR (getBuildingUsage() = "facilities for power generation" 

	 AND (getBuildingUsage() = "myBuilding"



	 OR (getBuildingUsage() = "cemeteries and related facilities"

	 AND getBuildingUsage() != "Crematorium") 





}



KS{

Floor myFloor{
Floor.number < 0
}

          getBuildingStoriesCount() >= 3 

	  AND isExist(myFloor) = TRUE

} 




Python Code 변환 예정



76
건축법 시행령 제 34조 1 항

① 건축물의 피난층(직접 지상으로 통하는 출입구가 있는 층을 말한다. 이하 같다) 외의 층에서는 피난층 또는 지상으로 통하는 직통계단(경사로를 포함한다. 이하 같다)을 거실의 각 부분으로부터 계단(거실로부터 가장 가까운 거리에 있는 계단을 말한다)에 이르는 보행거리가 30미터 이하가 되도록 설치하여야 한다. 다만, 건축물(지하층에 설치하는 것으로서 바닥면적의 합계가 300제곱미터 이상인 공연장·집회장·관람장 및 전시장은 제외한다)의 주요구조부가 내화구조 또는 불연재료로 된 건축물은 그 보행거리가 50미터(층수가 16층 이상인 공동주택은 40미터) 이하가 되도록 설치할 수 있으며, 자동화 생산시설에 스프링클러 등 자동식 소화설비를 설치한 공장으로서 국토해양부령으로 정하는 공장인 경우에는 그 보행거리가 75미터(무인화 공장인 경우에는 100미터) 이하가 되도록 설치할 수 있다. <개정 2009.7.16>





// 건축법 시행령 34조 (직통계단의 설치) 1항

Check(EDBA_34_1){
     KS
}

KS{
Floor myFloor{
      isObjectProperty(Floor.isEscape) = TRUE
}

Space mySpace{
      getObjectProperty(Space.usage)="PerformanceHall"
      OR getObjectProperty(Space.usage)="AssemblyHall"
      OR getObjectProperty(Space.usage)="Auditorium"	
      OR getObjectProperty(Space.usage)="ExhibitionHall"
}

Door myDoor{
     isDirectlyAccessible(Door, Ground)=TRUE
}

Stair myStair{
     isObjectProperty(Stair.isDirect)=TRUE
     isAccessible(Stair,myFloor)=TRUE
     OR isAccessible(Stair,Ground)=TRUE
}

Ramp myRamp{
     isAccessible(Ramp,myFloor)=TRUE
     OR isAccessible(Ramp,Ground)=TRUE
}

Floor myFloor2{
     isObjectProperty(Floor.isEscape)=FALSE
     OR hasObject(Floor, myDoor)=FALSE
}

	Zone myZone{

		isDirectlyAccessible(myStair, Zone)=FALSE

	}

 

IF

	getFloorNumber(mySpace)>0

	getFloorArea(mySpace)<=300 m2

	isFireResistantStructure(MainStructuralPart)=TRUE

	OR isObjectProperty(MainStructuralPart.Material.nonCombustibility)=TRUE 

	THEN IF        getBuildingStoriesCount()>=16

	               getBuildingUsage()="MultiUnitHouse"

	          THEN ED= 40 

	ELSE THEN   ED=50               

	END IF



ELSE IF   

	getBuildingUsage() = "Factory" 

	isExist(ExtinguishingSystem)=TRUE 

	isObjectProperty(ExtinguishingSystem.isAutomatic)=TRUE

	getResult(REFB_8_2)=TRUE

	THEN IF   	getBuildingUsage() = "UnmannedFactory" 

			THEN ED=100

	ELSE THEN  ED=75

	END IF 



ELSE THEN ED=30

	END IF 



	(hasObject(myFloor,myStair)=TRUE

	hasObject(myZone, myStair)=TRUE

	getObjectDistance(Room,myStair, 1)<=ED)

	OR 

	(hasObject(myFloor,myRamp)=TRUE

	hasObject(myZone, myRamp)=TRUE

	getObjectDistance(Room,myRamp, 1)<=ED)

} 








max_route_length = 30

def Check():
    evac_storey_exist = False
    stories = SELECT('storey')

    for storey in stories:
        if storey.SELECT('is evacuation storey').BOOL() == True:
            evac_storey_exist = True
            break

    if evac_storey_exist == False:
        ERROR('피난층이 존재하지 않습니다.')
        return

    for storey in stories:
        if storey.SELECT('is evacuation storey').BOOL() == True:
            continue

        stairs = storey.SELECT('direct stair')

        if stairs.COUNT() == 0:
            storey.ERROR(storey.SELECT('name').STRING() + '에 직통계단이 존재하지 않습니다.')
            continue

        for space in storey.SELECT('space'):
            route_length = -1
            for route in space.SELECT('escape route', stairs):
                length = route.SELECT('length').UNIT('m').NUMBER()
                if length > 0:
                    if route_length < 0:
                        route_length = length
                    else:
                        route_length = min([route_length, length])
            if route_length < 0:
                space.ERROR(space.SELECT('name').STRING() + '부터 직통계단까지 갈 수 없다.')
            elif route_length > max_route_length:
                space.ERROR(space.SELECT('name').STRING() + '부터 직통계단까지의 거리가 멀다 : ' + str(route_length))
            else:
                space.SUCCESS(space.SELECT('name').STRING() + ' : ' + str(route_length)) 





77
건축법 시행령 제 34조 2 항 2호

2. 단독주택 중 다중주택·다가구주택, 제2종 근린생활시설 중 학원·독서실, 판매시설, 운수시설(여객용 시설만 해당한다), 의료시설(입원실이 없는 치과병원은 제외한다), 교육연구시설 중 학원, 노유자시설 중 아동 관련 시설·노인복지시설, 수련시설 중 유스호스텔, 숙박시설 또는 장례식장의 용도로 쓰는 3층 이상의 층으로서 그 층의 해당 용도로 쓰는 거실의 바닥면적의 합계가 200제곱미터 이상인 것





//건축법 시행령 34조 (직통계단의 설치) 2항2호

Check(EDBA_34_2_2){



        Building myBuilding{

              getBuildingUsage()="DentalClinic"

        }


Space mySpace{
getSpaceUsage() = "Ward"
}
	Floor myFloor1 {

		getObjectProperty(Floor.number)>=3

                getObjectUsage(Floor)  = “DetachedHouse.MultiUserHouse”

		OR getObjectUsage(Floor)  = “DetachedHouse.MultiFamilyHouse”

		OR getObjectUsage(Floor)  = “ClassIINeighborhoodLivingFacility.EducationalInstitute”

		OR getObjectUsage(Floor)  = “ClassIINeighborhoodLivingFacility.ReadingRooms” 

                OR getObjectUsage(Floor)  = “CommercialFacility”

                OR getObjectUsage(Floor)  = “TransportationFacility.PassengerTrafficFacilities”

                OR ( getObjectUsage(Floor)  = “MedicalFacility” ADN hasObject(myBuilding, mySpace)=TRUE )

                OR getObjectUsage(Floor)  = “EducationAndResearchFacility.EducationalInstitutes” 

		OR getObjectUsage(Floor)  = “FacilitiesForTheAgedAndChildren.ChildrenRelatedFacilities” 

		OR getObjectUsage(Floor)  = “EducationAndResearchFacility.WelfareFacilityForTheAged” 

		OR getObjectUsage(Floor)  = “Trainingfacility.YouthHostel” 

		OR getObjectUsage(Floor)  = “LodgingFacility”

                

	}



	Floor myFloor2{

		 getObjectUsage(Floor)  = “ClassIINeighborhoodLivingFacility.FacilityForProvidingInternetComputerGameService”

		}



           getTotalFloorArea(myFloor1.Room)>= 200 m2

          OR getTotalFloorArea(myFloor2.Room)>= 300 m2	

} 




Python Code 변환 예정



78
건축법 시행령 제 34조 3 항

③ 초고층 건축물에는 피난층 또는 지상으로 통하는 직통계단과 직접 연결되는 피난안전구역(초고층 건축물의 피난·안전을 위하여 지상층으로부터 최대 30개 층마다 설치하는 대피공간을 말한다. 이하 같다)을 설치하여야 한다. <신설 2009.7.16>





// 건축법 시행령 제 34조 (직통계단의 설치) 3항

check(EDBA_34_3){

		IF CS THEN KS ENDIF

}



CS{

isObjectProperty(Building.isHighriseBuilding) = TRUE

}

KS{

		Stair myStair{

				isObjectProperty(Stair.isDirect) = TRUE			

		}

		Zone myZone{

				isObjectProperty(Zone.isEgressSafetyZone) = TRUE

		}

		Floor myFloor{

				isObjectProperty(Floor.isEscape) = TRUE

		}

isGoThrough(myFloor, myZone, myStair) = TRUE

		OR isGoThrough(myFloor, Ground, myStair) = TRUE



		getObjectCount(myZone) >= getBuildingStoriesCount()/30

} 




Python Code 변환 예정



79
건축법 시행령 제 34조 4 항

④ 제3항에 따른 피난안전구역의 규모와 설치기준은 국토해양부령으로 정한다. <신설 2009.7.16>





// 건축법 시행령 34조 (직통계단의 설치) 4항

check(EDBA_34_4){

		IF !CS THEN KS ENDIF

}

CS{

		Stair myStair{

				isObjectProperty(Stair.isDirect) = TRUE

		}

		Floor myFloor{

				isObjectProperty(Floor.isEscape) = TRUE

		}

		isDirectlyAccessible(myStair, myFloor) = TRUE

		OR isDirectlyAccessible(myStair, Ground) = TRUE

}

				

KS{

		isObjectProperty(Building.isQuasiHighriseBuilding) = TRUE

		Stair myStair{

				isObjectProperty(Stair.isDirect) = TRUE			

		}

		Zone myZone{

				isObjectProperty(Zone.isEgressSafetyZone) = TRUE

		}

		Floor myFloor{

				isObjectProperty(Floor.isEscape) = TRUE

		}

                isGoThrough(myFloor, myZone, myStair) = TRUE

		OR isGoThrough(myFloor, Ground, myStair) = TRUE

		(getBuildingStoriesCount()/2)-5 < getFloorNumber(myZone)

                getFloorNumber(myZone) < (getBuildingStoriesCount()/2)+5

} 




Python Code 변환 예정



80
건축법 시행령 제 40조 3 항

③ 층수가 11층 이상인 건축물로서 11층 이상인 층의 바닥면적의 합계가 1만 제곱미터 이상인 건축물(지붕을 평지붕으로 하는 경우만 해당한다)의 옥상에는 국토해양부령으로 정하는 기준에 따라 헬리포트를 설치하거나 헬리콥터를 통하여 인명 등을 구조할 수 있는 공간을 확보하여야 한다. <개정 2009.7.16>





//건축법 시행령 40조 (옥상광장 등의 설치) 3항
Check(EDBA_40_3){
  IF (CS) THEN KS 
}

CS{
	Floor myFloor{
		Floor.number > 11
	}

   	getBuildingStoriesCount() > 11
   	getTotalFloorArea(myFloor) > 10000m2
}

KS{
  getResult(EDBA_40_3_1) = True
  getResult(EDBA_40_3_2) = True
}
 




Python Code 변환 예정



81
건축법 시행령 제 47조 1 항 3호

3. 공동주택과 위락시설이 같은 초고층 건축물에 있는 경우. 다만, 사생활을 보호하고 방범·방화 등 주거 안전을 보장하며 소음·악취 등으로부터 주거환경을 보호할 수 있도록 주택의 출입구·계단 및 승강기 등을 주택 외의 시설과 분리된 구조로 하여야 한다.





//건축법 시행령 47조 (방화에 장애가 되는 용도의 제한) 1항 3호

Check(EDBA_47_1_3){
         KS
}

KS{
    Space mySpace1{
        getSpaceUsage(Space)="MultiUnitHouse"
    }
 
    Space mySpace2{
        getSpaceUsage(Space)="AmusementFacility"
    }

  
    Building myBuilding{
       isObjectProperty(Building.isHighriseBuilding)=True
    }

   
    isExistTogether(mySpace1, mySpace2, myBuilding)=True

   //다만, 주택의 출입구ㆍ계단 및 승강기 등을 주택 외의 시설과 분리된 구조로 하여야 한다.

} 




Python Code 변환 예정



82
건축법 시행령 제 47조 2 항

② 법 제49조제2항에 따라 다음 각 호의 어느 하나에 해당하는 용도의 시설은 같은 건축물에 함께 설치할 수 없다. <개정 2009.7.16>





//건축법 시행령 47조 (방화에 장애가 되는 용도의 제한) 2항 



Check(EDBA_47_2){

      KS

}



  Space  myFacility{

    getResult(EDBA_47_2_1)=True

  } 



  Space  myFacility2{

    OR getResult(EDBA_47_2_2)=True

  } 

     



KS{

    isShared(myFacility.Building, myFacility2.Building)=False

} 




Python Code 변환 예정



83
건축법 시행령 제 47조 2 항 1호

1. 노유자시설 중 아동 관련 시설 또는 노인복지시설과 판매시설 중 도매시장 또는 소매시장





//건축법 시행령 47조 (방화에 장애가 되는 용도의 제한) 2항 1호

Check(EDBA_47_2_1){
       KS
}

KS{
     getBuildingUsage()="FacilitiesForTheAgedAndChildren.ChildrenRelatedFacility"
     OR getBuildingUsage()="FacilitiesForTheAgedAndChildren.WelfareFacilityForTheAged" 
     OR getBuildingUsage()="CommercialFacility.WholesaleMarket"
     OR getBuildingUsage()="CommercialFacility.RetailMarket"
} 




Python Code 변환 예정



84
건축법 시행령 제 47조 2 항 2호

2. 공동주택과 제2종 근린생활시설 중 고시원





//건축법 시행령 47조 (방화에 장애가 되는 용도의 제한) 2항 2호



Check(EDBA_47_2_2){

      KS

}



KS{

       getBuildingUsage()="DetachedHouse.MultiUserHouse"

       OR getBuildingUsage()="DetachedHouse.MultiFamilyHouse"

       OR getBuildingUsage()="MultiUnitHouse"

       OR getBuildingUsage()="ClassINeighborhoodLivingFacility.MaternityCenter"

       OR getBuildingUsage()="ClassINeighborhoodLivingFacility.PostnatalCareCenter"

       OR getBuildingUsage()="ClassIINeighborhoodLivingFacility.CommunalLivingFacility"



} 




Python Code 변환 예정



85
건축법 시행령 제 51조 3 항

③ 법 제49조제2항에 따라 오피스텔에 거실 바닥으로부터 높이 1.2미터 이하 부분에 여닫을 수 있는 창문을 설치하는 경우에는 국토해양부령으로 정하는 기준에 따라 추락방지를 위한 안전시설을 설치하여야 한다. <신설 2009.7.16>





// 건축법 시행령 51조 (거실의 채광 등) 3항

check(EDBA_51_3){

	IF CS THEN KS

}



CS{

Window myWindow{
getObjectProperty(Window.panelOperationType) = "SwingingWindow"
}
	getBuildingUsage() = "Officetels.Room"

	getElementHeight(myWindow) <= 1.2 m

}



KS{

	isExist(FallPreventionSafetyFacility) = TRUE

	getResult(REFB_17_4) = TRUE

} 








min_win_h = 1.2
min_rail_h = 1.2
min_win_h_label = '기준 창문 높이'
min_rail_h_label = '최소 난간 높이'

def Check():
    for building in SELECT('building'):
        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()
        if not (bldg_use == '업무시설' and sub_use == '오피스텔'):
            continue
        for space in building.SELECT('space'):
            for win in space.SELECT('window'):
                if win.SELECT('lower edge height').UNIT('m').NUMBER() > min_win_h:
                    continue
                for railing in win.SELECT('railing'):
                    height = railing.SELECT('height').UNIT('m')
                    h = height.NUMBER()
                    if h < min_rail_h:
                        height.ERROR('난간 높이: ' + str(h) + 'm(< ' + str(min_rail_h) + 'm)')
                    else:
                        height.SUCCESS('난간 높이: ' + str(h) + 'm(>= ' + str(min_rail_h) + 'm)')

                    return

                win.ERROR('난간이 존재하지 않습니다.') 





86
건축법 시행령 제 8조 3 항 1호

1. 공동주택





//건축법 시행령 8조 (건축허가) 3항 1호

Check(EDBA_8_3_1){
     KS
}
KS{
	getBuildingUsage() = "MultiUnitHouse"
} 








def Check():
    typ = SELECT('typology').STRING().lower()
    if typ == "MultiUnitHouse":
        building.SUCCESS("Building Usage is MultiUniteHouse")
    else:
        building.ERROR("Building Usage is not MultiUnitHouse") 





87
건축법 시행령 제 8조 3 항 5호

5. 위락시설





//건축법 시행령 8조 (건축허가) 3항 5호

Check(EDBA_8_3_5){
     KS
}
KS{
	getBuildingUsage() = "AmusementFacility"
} 








def Check():
    typ = SELECT('typology').STRING().lower()
    if typ == "MultiUnitHouse":
        building.SUCCESS("Building Usage is AmusementFacility")
    else:
        building.ERROR("Building Usage is not AmusementFacility") 
 





88
건축법 시행령 제 38조 2호

2. 문화 및 집회시설(전시장 및 동ㆍ식물원은 제외한다)





//건축법 시행령 38조(관람석 등으로부터의 출구 설치) 2호
Check(EDBA_38_0_2){
     getBuildingUsage() = "CulturalAndAssemblyFacility
"
     getBuildingUsage() != "CulturalAndAssemblyFacility.ExhibitionHall"
     getBuildingUsage() != "CulturalAndAssemblyFacility.ZoologicalAndBotanicalGarden"

     getResult(REFB_10_2) = TRUE
}

 








identified_space_codes =[' 문화 및 집회시설']
min_area = 300
min_door_width = 1.5
min_door_count = 2
identified_space_codes_label ='해당 공간 명칭'
min_area_label = '바닥면적이 다음 미만일 경우 제외(m2)'
min_door_width_label = '출구 유효너비'
min_door_count_label = '유효너비 이상 최소 출구 개수'

def Check():
    for space in SELECT('space'):
        name = space.SELECT('name').STRING()
        code = space.SELECT('class code').STRING()

        if not code in identified_space_codes:
            continue
                
        area = space.SELECT('area').UNIT('m2').NUMBER()
        if area >= min_area:
            exitCnt = 0
            door_width_sum = 0
            inward_exist = False

            for door in space.SELECT('space door'):
                if door.SELECT('is inward', space).BOOL() == False:
                    door_width = door.SELECT('width').UNIT('m2').NUMBER()
                    if door_width >= min_door_width:
                        exitCnt += 1
                        door_width_sum += door_width
                else:
                    door.ERROR('안여닫이 출구')
                    inward_exist = True
                    
            if inward_exist == True:
                continue

            if exitCnt >= min_door_count:
                if door_width_sum >= (area / 100) * 0.6:
                    space.SUCCESS(name)
                else:
                    space.ERROR(name + ', 출구유효너비 합: ' + str(door_width_sum) + 'm, 바닥면적: ' + str(area) + 'm2')
            else:
                space.ERROR(name + ', 출구 수 : ' + str(exitCnt) + '( < ' + str(min_door_count) + ')')
        else:
            space.SUCCESS('바닥면적:' + str(area) + '㎡ ( < ' + str(min_area) + '㎡)') 





89
건축법 시행령 제 38조 3호

3. 종교시설





//건축법 시행령 38조(관람석 등으로부터의 출구 설치) 3호
Check(EDBA_38_0_3){
    getBuildingUsage() = "ReligiousFacility" 
}
 








identified_space_codes =['종교시설']
min_area = 300
min_door_width = 1.5
min_door_count = 2
identified_space_codes_label ='해당 공간 명칭'
min_area_label = '바닥면적이 다음 미만일 경우 제외(m2)'
min_door_width_label = '출구 유효너비'
min_door_count_label = '유효너비 이상 최소 출구 개수'

def Check():
    for space in SELECT('space'):
        name = space.SELECT('name').STRING()
        code = space.SELECT('class code').STRING()

        if not code in identified_space_codes:
            continue
                
        area = space.SELECT('area').UNIT('m2').NUMBER()
        if area >= min_area:
            exitCnt = 0
            door_width_sum = 0
            inward_exist = False

            for door in space.SELECT('space door'):
                if door.SELECT('is inward', space).BOOL() == False:
                    door_width = door.SELECT('width').UNIT('m2').NUMBER()
                    if door_width >= min_door_width:
                        exitCnt += 1
                        door_width_sum += door_width
                else:
                    door.ERROR('안여닫이 출구')
                    inward_exist = True
                    
            if inward_exist == True:
                continue

            if exitCnt >= min_door_count:
                if door_width_sum >= (area / 100) * 0.6:
                    space.SUCCESS(name)
                else:
                    space.ERROR(name + ', 출구유효너비 합: ' + str(door_width_sum) + 'm, 바닥면적: ' + str(area) + 'm2')
            else:
                space.ERROR(name + ', 출구 수 : ' + str(exitCnt) + '( < ' + str(min_door_count) + ')')
        else:
            space.SUCCESS('바닥면적:' + str(area) + '㎡ ( < ' + str(min_area) + '㎡)') 





90
국토의 계획 및 이용에 관한 법률 제 77조 1 항 1호 가 목

가. 주거지역: 70퍼센트 이하





//국토의 계획 및 이용에 관한 법률 77조 (용도지역의 건폐율) 1항 1호 가목
Check(LPUA_77_1_1_1){
	IF CS THEN KS
}
	
CS{
	getObjectProperty(SpecialPurposeArea.type) = "ResidentialArea"
}

KS{
	getObjectProperty(Building.buildingToLandRatio) = BTL
	BTL <= 70
} 




Python Code 변환 예정



91
국토의 계획 및 이용에 관한 법률 제 77조 1 항 1호 나 목

나. 상업지역: 90퍼센트 이하





//국토의 계획 및 이용에 관한 법률 77조 (용도지역의 건폐율) 1항 1호 나목
Check(LPUA_77_1_1_2){
	IF CS THEN KS
}
		
CS{
	getObjectProperty(SpecialPurposeArea.type) = "CommercialArea"
}

KS{
	getObjectProperty(Building.buildingToLandRatio) = BTL
	BTL <= 90
} 




Python Code 변환 예정



92
국토의 계획 및 이용에 관한 법률 제 77조 1 항 1호 다 목

다. 공업지역: 70퍼센트 이하





//국토의 계획 및 이용에 관한 법률 77조 (용도지역의 건폐율) 1항 1호 다목
Check(LPUA_77_1_1_3){
	IF CS THEN KS
}
	
CS{
	getObjectProperty(SpecialPurposeArea.type) = "IndustrialArea"
}

KS{
	getObjectProperty(Building.buildingToLandRatio) = BTL
	BTL <= 70
} 




Python Code 변환 예정



93
국토의 계획 및 이용에 관한 법률 제 77조 1 항 1호 라 목

라. 녹지지역: 20퍼센트 이하





//국토의 계획 및 이용에 관한 법률 77조 (용도지역의 건폐율) 1항 1호 라목
Check(LPUA_77_1_1_4){
	IF CS THEN KS
}
	
CS{
	getObjectProperty(SpecialPurposeArea.type) = "GreenArea"
}

KS{
	getObjectProperty(Building.buildingToLandRatio) = BTL
	BTL <= 20
} 




Python Code 변환 예정



94
국토의 계획 및 이용에 관한 법률 제 77조 1 항 2호 가 목

가. 보전관리지역: 20퍼센트 이하





//국토의 계획 및 이용에 관한 법률 77조 (용도지역의 건폐율) 1항 2호 가목
Check(LPUA_77_1_2_1){
	IF CS THEN KS
}
		
CS{
	getObjectProperty(SpecialPurposeArea.type) = "ConservationManagementArea"
}

KS{
	getObjectProperty(Building.buildingToLandRatio) = BTL
	BTL <= 20
} 




Python Code 변환 예정



95
국토의 계획 및 이용에 관한 법률 제 77조 1 항 2호 나 목

나. 생산관리지역: 20퍼센트 이하





//국토의 계획 및 이용에 관한 법률 77조 (용도지역의 건폐율) 1항 2호 나목
Check(LPUA_77_1_2_2){
	IF CS THEN KS
}
		
CS{
	getObjectProperty(SpecialPurposeArea.type) = "ProductionManagementArea"
}

KS{
	getObjectProperty(Building.buildingToLandRatio) = BTL
	BTL <= 20
} 




Python Code 변환 예정



96
국토의 계획 및 이용에 관한 법률 제 77조 1 항 2호 다 목

다. 계획관리지역: 40퍼센트 이하





//국토의 계획 및 이용에 관한 법률 77조 (용도지역의 건폐율) 1항 2호 다목
Check(LPUA_77_1_2_3){
	IF CS THEN KS
}
		
CS{
	getObjectProperty(SpecialPurposeArea.type) = "PlanningManagementArea"
}

KS{
	getObjectProperty(Building.buildingToLandRatio) = BTL
	BTL <= 40
} 




Python Code 변환 예정



97
국토의 계획 및 이용에 관한 법률 제 77조 1 항 3호

3. 농림지역: 20퍼센트 이하





//국토의 계획 및 이용에 관한 법률 77조 (용도지역의 건폐율) 1항 3호
Check(LPUA_77_1_3){
	IF CS THEN KS
}
		
CS{
	getObjectProperty(SpecialPurposeArea.type) = "AgriculturalAndForestryArea"
}

KS{
	getObjectProperty(Building.buildingToLandRatio) = BTL
	BTL <= 20
} 




Python Code 변환 예정



98
국토의 계획 및 이용에 관한 법률 제 77조 1 항 4호

4. 자연환경보전지역: 20퍼센트 이하





//국토의 계획 및 이용에 관한 법률 77조 (용도지역의 건폐율) 1항 4호
Check(LPUA_77_1_4){
	IF CS THEN KS
}
		
CS{
	getObjectProperty(SpecialPurposeArea.type) = "NaturalEnvironmentConservationArea"
}

KS{
	getObjectProperty(Building.buildingToLandRatio) = BTL
	BTL <= 20
} 




Python Code 변환 예정



99
국토의 계획 및 이용에 관한 법률 제 77조 3 항

③ 다음 각 호의 어느 하나에 해당하는 지역에서의 건폐율에 관한 기준은 제1항과 제2항에도 불구하고 80퍼센트 이하의 범위에서 대통령령으로 정하는 기준에 따라 특별시ㆍ광역시ㆍ특별자치시ㆍ특별자치도ㆍ시 또는 군의 조례로 따로 정한다. <개정 2011.4.14, 2011.8.4, 2015.8.11, 2017.4.18>





//국토의 계획 및 이용에 관한 법률 77조 (용도지역의 건폐율) 3항
Check(LPUA_77_3){
	IF CS THEN KS
}
		
CS{
	getResult(LPUA_77_3_1) = TRUE
	OR getResult(LPUA_77_3_2) = TRUE
	OR getResult(LPUA_77_3_3) = TRUE
	OR getResult(LPUA_77_3_4) = TRUE
	OR getResult(LPUA_77_3_5) = TRUE
	OR getResult(LPUA_77_3_6) = TRUE
}

KS{
	getObjectProperty(Building.buildingToLandRatio) = BTL
	BTL <= 80
} 




Python Code 변환 예정



100
국토의 계획 및 이용에 관한 법률 제 78조 1 항 1호

1. 도시지역





// 국토의 계획 및 이용에 관한 법률 78조 (용도지역에서의 용적률) 1항 1호

Check(LPUA_78_1_1){
IF CS THEN KS
}

CS{
getObjectProperty(Building.SpecialPurposeArea.type) = "UrbanArea"
}
KS{
getResult(LPUA_78_1_1_가)=TRUE
OR getResult(LPUA_78_1_1_나)=TRUE
OR getResult(LPUA_78_1_1_다)=TRUE
OR getResult(LPUA_78_1_1_라)=TRUE

}
 




Python Code 변환 예정



  ◁prev 1   2   3   4   next▷