개방형BIM 기반의 건축설계 적법성 평가 자동화 기술 및 응용기술 개발
Development of OpenBIM based Architectural Design Code Checking and Evaluation Technology
  Welcome to BIM - 2nd Project Website - Yonsei University
PAGE MENU  
전체법규 - 법규데이터베이스
- 대한민국 전체 법규 목록
- 설계품질검토 대상 관련법규
- 관련법규 변동 현황
대상법규 - 문장 논리규칙체계화
- 조항단위 논리규칙체계
- 문장단위 논리규칙체계
주어부 - 객체.속성 데이터베이스
- 법규로부터의 객체.속성 분류
- 명칭DB: 객체 | 객체및속성
서술부 - 함수 데이터베이스
- 논리규칙화 함수 분류
- 논리규칙화 함수 DB
관계부 - 문장 내.외 관계논리
- 문장 내.외 관계유형분류
- 문장 내.외관계 논리체계화
문장단위 | 체크리스트 단위
KBimCode 데이터베이스
- KBimCode Lang. Definition
- KBimCode Editor:
전체 개발항목 단위
우선순위 개발항목 단위
- KBimCode DB 2단계:
문장단위 | 조항단위 |
분야/용도/단계 체크리스트 단위
- KBimLogic Applications
KBimAssess Code 데이터베이스
- Executable KBimAssess Code
- KBimCode-Assess 연동모듈
 
(2025-06-28 기준) KBIMCode - KBimAssess Python Code Database (문장단위)
    1      
1 / 1 page Total 79/ records    신규입력 엑셀저장
Select
ALL
None
#
ID
Law
Jo
JO Name
HANG
HO
MOK
Text
Search!
1
11463 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 19조 3 항

③ 법 제49조제3항에 따른 가구ㆍ세대 등 간 소음방지를 위한 바닥은 경량충격음(비교적 가볍고 딱딱한 충격에 의한 바닥충격음을 말한다)과 중량충격음(무겁고 부드러운 충격에 의한 바닥충격음을 말한다)을 차단할 수 있는 구조로 하여야 한다. <신설 2014.11.28>





check(REFB_19_1){

     KS

}



KS{

Wall myWall{
   isObjectProperty(Wall.isPartitionWall) = TRUE
}
Floor myFloor{
hasObject(Floor, myWall)
}
   isFireResistantStructure(myWall)=TRUE
(isConnectedTo(myWall, Roof.BottomSurface) = TRUE
 OR isCOnnectedTo(myWall, myFloor.UpperFloor.FloorSlab) = TRUE)

} 








def Check():
    for building in SELECT('building'):
        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()
        space_codes = []
        
        if bldg_use == '단독주택' and sub_use == '다가구주택':
            space_codes = ['가구'] #가구
        elif (bldg_use == '공동주택' and sub_use != '기숙사') or (bldg_use == '노유자시설' and sub_use == '노인복지주택'):
            space_codes = ['33237'] #세대
        elif bldg_use == '공동주택' and sub_use == '기숙사':
            space_codes = ['33230'] #침실
        elif bldg_use == '의료시설':
            space_codes = ['34310'] #병실
        elif bldg_use == '교육연구시설' and sub_use == '학교':
            space_codes = ['34404', '34409']    #교실
        elif bldg_use == '숙박시설':
            space_codes = ['33201'] #객실
        elif (bldg_use == '제2종 근린생활시설' and sub_use == '다중생활시설') or (bldg_use == '노유자시설' and sub_use == '노인요양시설'):
            space_codes = ['호실'] #호실
        else:
            return

        for storey in building.SELECT('storey'):
            walls_list = []
            for space in storey.SELECT('space'):
                code = space.SELECT('class code').STRING()
                if code in space_codes:
                    walls_list.append(space.SELECT('wall'))
            
            n = len(walls_list)
            for i, walls in enumerate(walls_list):
                if i == n-1:
                    break
                for j, walls2 in enumerate(walls_list):
                    if i >= j:
                        continue
                    for wall in walls:
                        if wall.SELECT('isexterior').BOOL():
                            continue
                        id = wall.SELECT('element id').STRING()
                        for wall2 in walls2:
                            if wall2.SELECT('isexterior').BOOL():
                                continue
                            id2 = wall2.SELECT('element id').STRING()
                            if id == id2:
                                if wall.SELECT('prop', '경계벽').BOOL() == False:
                                    wall.ERROR('해당 벽은 경계벽이어야 합니다.')
                                else:
                                    if wall.SELECT('prop', '내화구조').BOOL() == False:
                                        wall.ERROR('경계벽은 내화구조이어야 합니다.')
                                    else:
                                        if wall.SELECT('top touched').BOOL():
                                            wall.SUCCESS('경계벽 조건에 부합합니다.')
                                        else:
                                            wall.ERROR('경계벽 상단이 슬라브와 닿지 않습니다.')
                                break 





View
Modify
2
11464 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 19조 4 항

④ 제3항에 따른 가구ㆍ세대 등 간 소음방지를 위한 바닥의 세부 기준은 국토교통부장관이 정하여 고시한다. <신설 2014.11.28>

KBimCode 입력 예정






def Check():
    for building in SELECT('building'):
        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()
        space_codes = []
        
        if bldg_use == '단독주택' and sub_use == '다가구주택':
            space_codes = ['가구'] #가구
        elif (bldg_use == '공동주택' and sub_use != '기숙사') or (bldg_use == '노유자시설' and sub_use == '노인복지주택'):
            space_codes = ['33237'] #세대
        elif bldg_use == '공동주택' and sub_use == '기숙사':
            space_codes = ['33230'] #침실
        elif bldg_use == '의료시설':
            space_codes = ['34310'] #병실
        elif bldg_use == '교육연구시설' and sub_use == '학교':
            space_codes = ['34404', '34409']    #교실
        elif bldg_use == '숙박시설':
            space_codes = ['33201'] #객실
        elif (bldg_use == '제2종 근린생활시설' and sub_use == '다중생활시설') or (bldg_use == '노유자시설' and sub_use == '노인요양시설'):
            space_codes = ['호실'] #호실
        else:
            return

        for storey in building.SELECT('storey'):
            walls_list = []
            for space in storey.SELECT('space'):
                code = space.SELECT('class code').STRING()
                if code in space_codes:
                    walls_list.append(space.SELECT('wall'))
            
            n = len(walls_list)
            for i, walls in enumerate(walls_list):
                if i == n-1:
                    break
                for j, walls2 in enumerate(walls_list):
                    if i >= j:
                        continue
                    for wall in walls:
                        if wall.SELECT('isexterior').BOOL():
                            continue
                        id = wall.SELECT('element id').STRING()
                        for wall2 in walls2:
                            if wall2.SELECT('isexterior').BOOL():
                                continue
                            id2 = wall2.SELECT('element id').STRING()
                            if id == id2:
                                if wall.SELECT('prop', '경계벽').BOOL() == False:
                                    wall.ERROR('해당 벽은 경계벽이어야 합니다.')
                                else:
                                    if wall.SELECT('prop', '내화구조').BOOL() == False:
                                        wall.ERROR('경계벽은 내화구조이어야 합니다.')
                                    else:
                                        if wall.SELECT('top touched').BOOL():
                                            wall.SUCCESS('경계벽 조건에 부합합니다.')
                                        else:
                                            wall.ERROR('경계벽 상단이 슬라브와 닿지 않습니다.')
                                break 





View
Modify
3
19375 건축물의 설비기준 등에 관한 규칙 제 9조 2호

2. 높이 31미터를 넘는 각층의 바닥면적의 합계가 500제곱미터 이하인 건축물





//건축물의 설비기준 등에 관한 규칙 9조 (비상용승강기를 설치하지 아니할 수 있는 건축물) 2호

Check(RFB_9_0_2){

   KS

}



KS{

    getBuildingHeight()>31 m

    getTotalFloorArea()<=500 m2

} 








def Check():
    bld = SELECT("building")
    bldHeight = bld.SELECT("height").UNIT("m").NUMBER()
    totalFloorArea = getTotalFloorArea()
    if bldHeight > 31 and totalFloorArea <=500:
        bld.SUCCESS("pass")
    else:
        bld.ERROR("error")
 

def getTotalFloorArea():
    totalArea = 0
    floors = SELECT("storey")
    for floor in floors:
        floorArea = floor.SELECT("area").UNIT('m2').NUMBER()
        totalArea += floorArea
    return totalArea 





View
Modify
4
19467 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 10조 1 항

제10조(관람석등으로부터의 출구의 설치기준) ①영 제38조 각호의 1에 해당하는 건축물의 관람석 또는 집회실로부터 바깥쪽으로의 출구로 쓰이는 문은 안여닫이로 하여서는 아니된다.





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 10조 (관람석등으로부터의 출구의 설치기준) 1항

check(REFB_10_1){

    Space mySpace = getSpace("Auditorium") + getSpace("AssemblyHall")



    Door myExit {

        isAccessible(mySpace, Door) = TRUE

        isObjectProperty(Door.isEntrance) = TRUE

    }

getObjectProperty(myExit.panelOperationType) != "OpeningInDoor"


} 








SUCCESS
theater_code = '00000'
std_floor_area = 300


theater_code_label = '관람석 공간분류코드'
std_floor_area_label = '기준 바닥면적'

def Check():
    for building in SELECT('building'):
        
        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()

        for storey in building.SELECT('storey'):
            for space in storey.SELECT('space'):
                if space.SELECT('name').STRING() not in ['관람석', '집회실':
                    continue
                for door in space.Select('door'):
                    if door.SELECT('type') is '안여닫이' :
                        door.ERROR('본 공간의 문은 안여닫이입니다.')
                    else:
                        door.SUCCESS('본 공간의 문은 안여닫이가 아닙니다.')
                         





View
Modify
5
19468 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 10조 2 항

②영 제38조의 규정에 의하여 문화 및 집회시설중 공연장의 개별관람석(바닥면적이 300제곱미터 이상인 것에 한한다)의 출구는 다음 각호의 기준에 적합하게 설치하여야 한다.





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 10조 (관람석등으로부터의 출구의 설치기준) 2항
check(REFB_10_2){
    IF (CS) THEN KS ENDIF
}

CS{
    getBuildingUsage() = "CulturalAndAssemblyFacility.PerformanceHall"

    Space mySpace = getSpace("individualSeats")
    getFloorArea(mySpace) >= 300

KS{
    getResult(REFB_10_2_1) = TRUE
    getResult(REFB_10_2_2) = TRUE
    getResult(REFB_10_2_3) = TRUE
} 








theater_code = '00000'
std_floor_area = 300


theater_code_label = '관람석 공간분류코드'
std_floor_area_label = '기준 바닥면적'

def Check():
    for building in SELECT('building'):
        if building.SELECT('prop', '연면적').NUMBER() <= std_floor_area:
            continue

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()

        if not (bldg_use == '문화 및 집회시설' and sub_use == '공연장'):
            building.SUCcESS('검토 대상 건물이 아닙니다.')
            continue
        for storey in building.SELECT('storey'):
            for space in storey.SELECT('space'):
                if space.SELECT('class code').STRING() != theater_code:
                    continue
                if space.SELECT('area').UNIT(m2).NUMBER() < std_floor_area:
                    continue
                door_w_total = 0
                door_cnt = 0
                for door in space.Select('door'):
                    door_cnt += 1 
                    door_w = door.SELECT('width').Unit(m).number()
                    door_w_total += door_w
                    if door_w >= 1.5:
                        door.SUCCESS('출구의 너비' + door_w +'>= 1.5m')
                    else:
                        door.ERROR('출구의 너비' + door_w +'< 1.5m')
                min_door_w_total = space.SELECT('area').UNIT(m2).NUMBER()
                min_door_w_total = min_door_w_total/100*0.6
                if door_w_total >= min_door_w_total :
                    space.SUCCESS('출구의 너비의 총합' + door_w_total +'>='+ min_door_w_total)
                else:
                    space.ERROR('출구의 너비의 총합' + door_w_total +'<' + min_door_w_total)
                if door_cnt >= 2:
                    space.SUCCESS('출구의 개수' + door_w_total +'>='+ '2')
                else:
                    space.ERROR('출구의 개수' + door_w_total +'<'+ '2')
 





View
Modify
6
19469 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 10조 2 항 1호

1. 관람석별로 2개소 이상 설치할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 10조 (관람석등으로부터의 출구의 설치기준) 2항 1호

check(REFB_10_2_1){

    Door myExit {

        Door.Space.name = "individualSeats"

        getFloorArea(Door.Space) >= 300

        isObjectProperty(Door.isEntrance) = TRUE

    }



    getObjectCount(myExit) >= 2

} 








SUCCESS
theater_code = '00000'
std_floor_area = 300


theater_code_label = '관람석 공간분류코드'
std_floor_area_label = '기준 바닥면적'

def Check():
    for building in SELECT('building'):
        if building.SELECT('prop', '연면적').NUMBER() <= std_floor_area:
            continue

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()

        if not (bldg_use == '문화 및 집회시설' and sub_use == '공연장'):
            building.SUCESS('검토 대상 건물이 아닙니다.')
            continue
        for storey in building.SELECT('storey'):
            for space in storey.SELECT('space'):
                if space.SELECT('class code').STRING() != theater_code:
                    continue
                if space.SELECT('area').UNIT(m2).NUMBER() < std_floor_area:
                    continue
                door_w_total = 0
                door_cnt = 0
                for door in space.Select('door'):
                    door_cnt += 1 
                    door_w = door.SELECT('width').Unit(m).number()
                    door_w_total += door_w
                    if door_w >= 1.5:
                        door.SUCCESS('출구의 너비' + door_w +'>= 1.5m')
                    else:
                        door.ERROR('출구의 너비' + door_w +'< 1.5m')
                min_door_w_total = space.SELECT('area').UNIT(m2).NUMBER()
                min_door_w_total = min_door_w_total/100*0.6
                if door_w_total >= min_door_w_total :
                    space.SUCCESS('출구의 너비의 총합' + door_w_total +'>='+ min_door_w_total)
                else:
                    space.ERROR('출구의 너비의 총합' + door_w_total +'<' + min_door_w_total)
                if door_cnt >= 2:
                    space.SUCCESS('출구의 개수' + door_w_total +'>='+ '2')
                else:
                    space.ERROR('출구의 개수' + door_w_total +'<'+ '2')
 





View
Modify
7
19470 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 10조 2 항 2호

2. 각 출구의 유효너비는 1.5미터 이상일 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 10조 (관람석등으로부터의 출구의 설치기준) 2항 2호

check(REFB_10_2_2){

    Door myExit {

        Door.Space.name = "individualSeats"

        getFloorArea(Door.Space) >= 300

        isObjectProperty(Door.isEntrance) = TRUE

    }



    getObjectWidth(myExit) >= 1.5m

} 








SUCCESS
theater_code = '00000'
std_floor_area = 300


theater_code_label = '관람석 공간분류코드'
std_floor_area_label = '기준 바닥면적'

def Check():
    for building in SELECT('building'):
        if building.SELECT('prop', '연면적').NUMBER() <= std_floor_area:
            continue

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()

        if not (bldg_use == '문화 및 집회시설' and sub_use == '공연장'):
            building.SUCESS('검토 대상 건물이 아닙니다.')
            continue
        for storey in building.SELECT('storey'):
            for space in storey.SELECT('space'):
                if space.SELECT('class code').STRING() != theater_code:
                    continue
                if space.SELECT('area').UNIT(m2).NUMBER() < std_floor_area:
                    continue
                door_w_total = 0
                door_cnt = 0
                for door in space.Select('door'):
                    door_cnt += 1 
                    door_w = door.SELECT('width').Unit(m).number()
                    door_w_total += door_w
                    if door_w >= 1.5:
                        door.SUCCESS('출구의 너비' + door_w +'>= 1.5m')
                    else:
                        door.ERROR('출구의 너비' + door_w +'< 1.5m')
                min_door_w_total = space.SELECT('area').UNIT(m2).NUMBER()
                min_door_w_total = min_door_w_total/100*0.6
                if door_w_total >= min_door_w_total :
                    space.SUCCESS('출구의 너비의 총합' + door_w_total +'>='+ min_door_w_total)
                else:
                    space.ERROR('출구의 너비의 총합' + door_w_total +'<' + min_door_w_total)
                if door_cnt >= 2:
                    space.SUCCESS('출구의 개수' + door_w_total +'>='+ '2')
                else:
                    space.ERROR('출구의 개수' + door_w_total +'<'+ '2')
 





View
Modify
8
19471 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 10조 2 항 3호

3. 개별 관람석 출구의 유효너비의 합계는 개별 관람석의 바닥면적 100제곱미터마다 0.6미터의 비율로 산정한 너비 이상으로 할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 10조 (관람석등으로부터의 출구의 설치기준) 2항 3호

check(REFB_10_2_3){

    Door myExit {

        Door.Space.name = "individualSeats"

        getFloorArea(Door.Space) >= 300

        isObjectProperty(Door.isEntrance) = TRUE

    }



    getTotalObjectWidth(myExit) >= getFloorArea(myExit.Space)/100*0.6

} 








SUCCESS
theater_code = '00000'
std_floor_area = 300


theater_code_label = '관람석 공간분류코드'
std_floor_area_label = '기준 바닥면적'

def Check():
    for building in SELECT('building'):
        if building.SELECT('prop', '연면적').NUMBER() <= std_floor_area:
            continue

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()

        if not (bldg_use == '문화 및 집회시설' and sub_use == '공연장'):
            building.SUCESS('검토 대상 건물이 아닙니다.')
            continue
        for storey in building.SELECT('storey'):
            for space in storey.SELECT('space'):
                if space.SELECT('class code').STRING() != theater_code:
                    continue
                if space.SELECT('area').UNIT(m2).NUMBER() < std_floor_area:
                    continue
                door_w_total = 0
                door_cnt = 0
                for door in space.Select('door'):
                    door_cnt += 1 
                    door_w = door.SELECT('width').Unit(m).number()
                    door_w_total += door_w
                    if door_w >= 1.5:
                        door.SUCCESS('출구의 너비' + door_w +'>= 1.5m')
                    else:
                        door.ERROR('출구의 너비' + door_w +'< 1.5m')
                min_door_w_total = space.SELECT('area').UNIT(m2).NUMBER()
                min_door_w_total = min_door_w_total/100*0.6
                if door_w_total >= min_door_w_total :
                    space.SUCCESS('출구의 너비의 총합' + door_w_total +'>='+ min_door_w_total)
                else:
                    space.ERROR('출구의 너비의 총합' + door_w_total +'<' + min_door_w_total)
                if door_cnt >= 2:
                    space.SUCCESS('출구의 개수' + door_w_total +'>='+ '2')
                else:
                    space.ERROR('출구의 개수' + door_w_total +'<'+ '2')
 





View
Modify
9
19640 건축법 시행령 제 38조 1호

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





//건축법 시행령 38조(관람석 등으로부터의 출구 설치) 1호
Check(EDBA_38_0_1){
     (getBuildingUsage() = "ClassIINeighborhoodLivingFacility.performancehall"
     OR getBuildingUsage() = "ClassIINeighborhoodLivingFacility.ReligiousAssemblyFacility")

     Space mySpace {
          getSpaceUsage(Space) = "ClassIINeighborhoodLivingFacility.performancehall"
          OR getSpaceUsage(Space) = "ClassIINeighborhoodLivingFacility.ReligiousAssemblyFacility"
     }

     getTotalFloorArea(mySpace) > 300
}

 








identified_space_codes =['33703', '33708']
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) + '㎡)') 





View
Modify
10
19643 건축법 시행령 제 38조 4호

4. 위락시설





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








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) + '㎡)') 





View
Modify
11
19644 건축법 시행령 제 38조 5호

5. 장례식장





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








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) + '㎡)') 





View
Modify
12
20067 건축물의 구조기준 등에 관한 규칙 제 39조 1호

1. 높이는 3미터 이하로 할 것





//건축물의 구조기준 등에 관한 규칙 39조 (조적식구조인 담) 1호
Check(RSSB_39_0_1){
	KS
}
KS{
	getObjectHeight(Fence) <= 3m
} 








def Check():
   fence = SELECT("fence")
   fenceHeight = fence.SELECT("height").NUMBER().UNIT('m')
   if fenceHeight <= 3:
      fence.SUCCESS("fence height: "+str(fenceHeight)+"m")
   else:
      fence.ERROR("fence height: "+str(fenceHeight)+"m") 





View
Modify
13
20079 건축물의 구조기준 등에 관한 규칙 제 45조 1호

1. 담의 높이는 3미터 이하로 할 것





//	건축물의 구조기준 등에 관한 규칙 45조 (보강블록구조의 담) 1항
Check(RSSB_45_1){
	getResult(RSSB_3_3) = TRUE AND KS
}

KS{
	getObjectHeight(Fence) <= 3m
} 








def Check():
   fence = SELECT("fence")
   fenceHeight = fence.SELECT("height").NUMBER().UNIT('m')
   if fenceHeight <= 3:
      fence.SUCCESS("fence height: "+str(fenceHeight)+"m")
   else:
      fence.ERROR("fence height: "+str(fenceHeight)+"m") 
 





View
Modify
14
25075 건축물의 설비기준 등에 관한 규칙 제 5조

제5조(승용승강기의 설치기준) 「건축법」(이하 "법"이라 한다) 제64조제1항에 따라 건축물에 설치하는 승용승강기의 설치기준은 별표 1의2와 같다. 다만, 승용승강기가 설치되어 있는 건축물에 1개층을 증축하는 경우에는 승용승강기의 승강로를 연장하여 설치하지 아니할 수 있다. <개정 2001.1.17, 2006.2.13, 2008.7.10, 2015.7.9>





//건축물의 설비기준 등에 관한 규칙 5조 (승용승강기의 설치기준) 

Check(RFB_5){

	IF !(CS) THEN KS1

}

CS{
getObjectProperty(Elevator.usage) = "PassengerElevator"
	isExist(Elevator) = TRUE
}

KS1{
        getResult(RFB_*_1-2) = TRUE
} 








def Check(RFB_5):


CS

myobject = getobject(PassengerElevator)
if isExist(myobject) = True:
    
else:
    
getObjectProperty(Elevator, usage) = "PassengerElevator"
is






def getobjectproperty(str objname, str propname):
    myobj = root.select(objname)
    myprop = myobj.select(propname)
    return myprop
  





View
Modify
15
25201 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 9조 2 항 2호 다 목

다. 계단의 유효너비는 0.9미터 이상으로 할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 9조 (피난계단 및 특별피난계단의 구조) 2항 2호 다목
check(REFB_9_2_3){
	KS     
}
KS {
	getObjectProperty(Stair.effectiveWidth)>= 0.9m
}
 








min_width = 0.9
min_width_label = 'Minimum Stair Width'

def Check():
    for stair in SELECT('stair'):
        dist = stair.SELECT('clear width')
        width = dist.UNIT('m').NUMBER()
        if width < min_width:
            dist.ERROR('Stair Clear Width : ' + str(width) + 'm')
        else:
            dist.SUCCESS('Stair Clear Width : ' + str(width) + 'm') 





View
Modify
16
25260 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 1 항

①영 제48조의 규정에 의하여 건축물에 설치하는 계단은 다음 각호의 기준에 적합하여야 한다. <개정 2010.4.7>





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 1항

check(REFB_15_1){

     KS

}



KS{

     getResult(REFB_15_1_1)= TRUE

     getResult(REFB_15_1_2)=TRUE

     getResult(REFB_15_1_3)=TRUE

     getResult(REFB_15_1_4)=TRUE

} 








std_floor_area = 200
std_floor_area_label = '기준 연면적'
min_w = 1.2
min_w_label = '최소 계단참 너비'
min_h = 2.1
min_h_label = '최소 계단 유효높이'

def Check():
    for building in SELECT('building'):
        if building.SELECT('prop', '연면적').NUMBER() <= std_floor_area:
            continue

        for stair in building.SELECT('stair'):
            height = stair.SELECT('height').UNIT('m')
            h = height.NUMBER()

            if h < min_h:
                stair.ERROR('계단 유효높이: ' + str(h) + ' < ' + str(min_h))
                continue

            if h >= 3:
                elv1 = stair.SELECT('elevation').UNIT('m').NUMBER()
                elv2 = elv1

                for width in stair.SELECT("clear landing width"):
                    elv2 = width.SELECT('elevation').UNIT('m').NUMBER()
                    if elv2 - elv1 > 3:
                        stair.ERROR('3m 이내마다 계단참이 존재하지 않습니다.')
                        break
                    elv1 = elv2

                    w = width.UNIT('m').NUMBER()
                    if w < min_w:
                        width.ERROR('계단참 유효너비: ' + str(w) + ' < ' + str(min_w))
                    else:
                        width.SUCCESS('계단참 유효너비: ' + str(w) + ' >= ' + str(min_w))

            if h >= 1:
                if stair.SELECT('rail').COUNT() == 0:
                    stair.ERROR('난간이 설치되지 않았습니다.')
                else:
                    stair.SUCCESS('난간이 설치되어 있습니다.') 





View
Modify
17
25261 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 1 항 1호

1. 높이가 3미터를 넘는 계단에는 높이 3미터이내마다 너비 1.2미터 이상의 계단참을 설치할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 1항1호
check(REFB_15_1_1){
     IF CS THEN KS
}

CS{
     getObjectHeight(Stair)>3 m
}

KS{
     isExist(StairLanding )= TRUE
     getPaceWidth(StairLanding>=1.2 m
     getObjectCount(StairLanding)>=getObjectCount(getObjectCount(StairLanding))/3
     IF getObjectCount(StairLanding)>1
          THEN   getObjectVerticalDistance(StairLanding ,StairLanding)>3 m   
     END IF 
} 








def Check():
    for building in SELECT('building'):
        for stair in building.SELECT('stair'):
            st_h = stair.SELECT('height').UNIT('m')
            st_h_num = height.NUMBER()
            if st_h_num >= 3:
                elv1 = stair.SELECT('elevation').UNIT('m').NUMBER()
                elv2 = elv1

                for width in stair.SELECT("clear landing width"):
                    elv2 = width.SELECT('elevation').UNIT('m').NUMBER()
                    if elv2 - elv1 > 3:
                        stair.ERROR('3m 이내마다 계단참이 존재하지 않습니다.')
                        breaker = True
                        break
                        
                    elv1 = elv2
                    w = width.UNIT('m').NUMBER()
                    if w < min_w:
                        width.ERROR('계단참 유효너비: ' + str(w) + ' < ' + str(min_w))
                    else:
                        width.SUCCESS('계단참 유효너비: ' + str(w) + ' >= ' + str(min_w)) 





View
Modify
18
25262 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 1 항 2호

2. 높이가 1미터를 넘는 계단 및 계단참의 양옆에는 난간(벽 또는 이에 대치되는 것을 포함한다)을 설치할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 1항2호

check(REFB_15_1_2){

      KS

}



KS{

      

     IF   getObjectHeight(Stair)>1 m 

          OR getObjectHeight(StairLanding)>1 m)

          THEN  isExist(Railing)=TRUE

     END IF

} 








def Check():
    for building in SELECT('building'):
        for stair in building.SELECT('stair'):
            st_h = stair.SELECT('height').UNIT('m')
            st_h_num = height.NUMBER()
            if st_h_num >= 1:
                if stair.SELECT('rail').COUNT() == 0:
                    stair.ERROR('난간이 설치되지 않았습니다.')
                else:
                    stair.SUCCESS('난간이 설치되어 있습니다.')
                     





View
Modify
19
25263 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 1 항 3호

3. 너비가 3미터를 넘는 계단에는 계단의 중간에 너비 3미터 이내마다 난간을 설치할 것. 다만, 계단의 단높이가 15센티미터 이하이고, 계단의 단너비가 30센티미터 이상인 경우에는 그러하지 아니하다.





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 1항3호
check(REFB_15_1_3){
     IF !CS THEN KS
}

CS{
      getStairStepHeight()<=15 cm
      getStairStepWidth()>=30 cm
}

KS{
   IF   getObjectWidth(Stair)>=3 m
       
       THEN  hasObject(Stair, Railing) = TRUE
             N=getObjectWidth(Stair)/3
             getObjectCount(Railing)>=N
            IF N>1
                 THEN getObjectDistance(Railing,Railing)<3 m
            END IF
   END IF 
}
 








def Check():
    for building in SELECT('building'):
        for stair in building.SELECT('stair'):
            st_w = stair.SELECT('width').UNIT('m')
            st_w_num = height.NUMBER()
            
            if st_w_num >= 3:
                for riser_height in stair.SELECT('riser height'):
                    riser_h_num = riser_height.UNIT('mm').NUMBER()
                    if riser_h_num <=  15:
                        braker = True
                        break
                for riser_width in stair.SELECT('riser width'):
                    riser_w_num = riser_width.UNIT('mm').NUMBER()
                    if riser_w_num >= 30:
                        braker = True
                        break
                if braker is True:
                    break
                else:
                    pass
                # 3미터 이내마다 난간 설치 확인을 위하여 난간간 간격 파악 필요

                 





View
Modify
20
25264 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 1 항 4호

4. 계단의 유효 높이(계단의 바닥 마감면부터 상부 구조체의 하부 마감면까지의 연직방향의 높이를 말한다)는 2.1미터 이상으로 할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 1항4호

check(REFB_15_1_4){

     KS

}



KS{

getObjectProperty(Stair.effectiveHeight)>=2.1 m

} 








min_h = 2.1
min_h_label = '최소 계단 유효높이'
def Check():
    for building in SELECT('building'):
        for stair in building.SELECT('stair'):
            st_h = stair.SELECT('height').UNIT('m')
            st_h_num = height.NUMBER()
            if st_h_num < min_h:
                stair.ERROR('계단 유효높이: ' + str(st_h_num) + ' < ' + str(min_h))
            else:
                stair.SUCCESS('계단 유효높이: ' + str(st_h_num) + ' >= ' + str(min_h)) 





View
Modify
21
25265 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 2 항

②제1항의 규정에 의하여 계단을 설치하는 경우 계단 및 계단참의 너비(옥내계단에 한한다), 계단의 단높이 및 단너비의 칫수는 다음 각호의 기준에 적합하여야 한다. 이 경우 돌음계단의 단너비는 그 좁은 너비의 끝부분으로부터 30센티미터의 위치에서 측정한다. <개정 2003.1.6, 2005.7.22, 2010.4.7>





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 2항
check(REFB_15_2){
     KS
}

KS{
      IF getResult(REFB_15_1)=TRUE

      THEN  getResult(REFB_15_2_1)=TRUE
            getResult(REFB_15_2_2)=TRUE
            getResult(REFB_15_2_3)=TRUE
            getResult(REFB_15_2_4)=TRUE
            getResult(REFB_15_2_5)=TRUE
            getResult(REFB_15_2_6)=TRUE
      END IF 
}
 









def Check():
    for building in SELECT('building'):

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()
        min_clear_w = 0.6
        max_riser_h = 0.0
        min_tread_w = 0.0

        if bldg_use == '교육연구시설':
            min_clear_w = 1.5            
            min_tread_w = 0.26
            if sub_use == '초등학교':
                max_riser_h = 0.16
            elif sub_use in ['중학교', '고등학교']:
                max_riser_h = 0.18
        elif (bldg_use == '문화 및 집회시설' and sub_use in ['공연장', '집회장', '관람장']) or (bldg_use == '판매시설'):
            min_clear_w = 1.2
        else:
            min_clear_w = 0.6 
        
        for storey in building.SELECT('storey'):
            for stair in storey.SELECT('stair'):
                clear_width = stair.SELECT('clear width').UNIT('m')
                clear_w = clear_width.NUMBER()
                
                if clear_w < min_clear_w:
                    clear_width.ERROR('유효너비: ' + str(clear_w) + ' < ' + str(min_clear_w))
                else:
                    clear_width.SUCCESS('유효너비: ' + str(clear_w) + ' >= ' + str(min_clear_w))

                if max_riser_h > 0:
                    for riser_height in stair.SELECT('riser height'):
                        riser_h = riser_height.UNIT('m').NUMBER()

                        if riser_h > max_riser_h:
                            riser_height.ERROR('단높이: ' + str(riser_h) + ' > ' + str(max_riser_h))
                            break

                if min_tread_w > 0:
                    for tread_width in stair.SELECT('tread width'):
                        tread_w = tread_width.UNIT('m').NUMBER()

                        if tread_w < min_tread_w:
                            tread_width.ERROR('단너비: ' + str(tread_w) + ' < ' + str(min_tread_w))
                            break 





View
Modify
22
25266 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 2 항 1호

1. 초등학교의 계단인 경우에는 계단 및 계단참의 너비는 150센티미터 이상, 단높이는 16센티미터 이하, 단너비는 26센티미터 이상으로 할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 2항1호
check(REFB_15_2_1){
     IF CS THEN KS
}

CS{
      getBuildingUsage()="ElementarySchool"
}

KS{
      getObjectWidth(Stair)>= 150 cm
      getObjectWidth(StairLanding)>150 cm
      getObjectProperty(Stair.riserHeight)>=16 cm
      getObjectProperty(Stair.riserWidth)>=26 cm
} 










def Check():
    for building in SELECT('building'):

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()
        min_clear_w = 0.6
        max_riser_h = 0.0
        min_tread_w = 0.0

        if bldg_use == '교육연구시설':
            min_clear_w = 1.5            
            min_tread_w = 0.26
            if sub_use == '초등학교':
                max_riser_h = 0.16
            elif sub_use in ['중학교', '고등학교']:
                max_riser_h = 0.18
        elif (bldg_use == '문화 및 집회시설' and sub_use in ['공연장', '집회장', '관람장']) or (bldg_use == '판매시설'):
            min_clear_w = 1.2
        else:
            min_clear_w = 0.6 
        
        for storey in building.SELECT('storey'):
            for stair in storey.SELECT('stair'):
                clear_width = stair.SELECT('clear width').UNIT('m')
                clear_w = clear_width.NUMBER()
                
                if clear_w < min_clear_w:
                    clear_width.ERROR('유효너비: ' + str(clear_w) + ' < ' + str(min_clear_w))
                else:
                    clear_width.SUCCESS('유효너비: ' + str(clear_w) + ' >= ' + str(min_clear_w))

                if max_riser_h > 0:
                    for riser_height in stair.SELECT('riser height'):
                        riser_h = riser_height.UNIT('m').NUMBER()

                        if riser_h > max_riser_h:
                            riser_height.ERROR('단높이: ' + str(riser_h) + ' > ' + str(max_riser_h))
                            break

                if min_tread_w > 0:
                    for tread_width in stair.SELECT('tread width'):
                        tread_w = tread_width.UNIT('m').NUMBER()

                        if tread_w < min_tread_w:
                            tread_width.ERROR('단너비: ' + str(tread_w) + ' < ' + str(min_tread_w))
                            break 





View
Modify
23
25267 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 2 항 2호

2. 중·고등학교의 계단인 경우에는 계단 및 계단참의 너비는 150센티미터 이상, 단높이는 18센티미터 이하, 단너비는 26센티미터 이상으로 할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 2항2호
check(REFB_15_2_2){
     IF CS THEN KS
}

CS{
       getBuildingUsage()="MiddleSchool"
       OR getBuildingUsage()="HighSchool"
}

KS{
      getObjectWidth(Stair)>=150 cm
      getObjectWidth(StairLanding)>150 cm
      getObjectProperty(Stair.riserHeight)>=18 cm
      getObjectProperty(Stair.riserWidth)>=26 cm
} 










def Check():
    for building in SELECT('building'):

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()
        min_clear_w = 0.6
        max_riser_h = 0.0
        min_tread_w = 0.0

        if bldg_use == '교육연구시설':
            min_clear_w = 1.5            
            min_tread_w = 0.26
            if sub_use == '초등학교':
                max_riser_h = 0.16
            elif sub_use in ['중학교', '고등학교']:
                max_riser_h = 0.18
        elif (bldg_use == '문화 및 집회시설' and sub_use in ['공연장', '집회장', '관람장']) or (bldg_use == '판매시설'):
            min_clear_w = 1.2
        else:
            min_clear_w = 0.6 
        
        for storey in building.SELECT('storey'):
            for stair in storey.SELECT('stair'):
                clear_width = stair.SELECT('clear width').UNIT('m')
                clear_w = clear_width.NUMBER()
                
                if clear_w < min_clear_w:
                    clear_width.ERROR('유효너비: ' + str(clear_w) + ' < ' + str(min_clear_w))
                else:
                    clear_width.SUCCESS('유효너비: ' + str(clear_w) + ' >= ' + str(min_clear_w))

                if max_riser_h > 0:
                    for riser_height in stair.SELECT('riser height'):
                        riser_h = riser_height.UNIT('m').NUMBER()

                        if riser_h > max_riser_h:
                            riser_height.ERROR('단높이: ' + str(riser_h) + ' > ' + str(max_riser_h))
                            break

                if min_tread_w > 0:
                    for tread_width in stair.SELECT('tread width'):
                        tread_w = tread_width.UNIT('m').NUMBER()

                        if tread_w < min_tread_w:
                            tread_width.ERROR('단너비: ' + str(tread_w) + ' < ' + str(min_tread_w))
                            break 





View
Modify
24
25268 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 2 항 3호

3. 문화 및 집회시설(공연장·집회장 및 관람장에 한한다)·판매시설 기타 이와 유사한 용도에 쓰이는 건축물의 계단인 경우에는 계단 및 계단참의 너비를 120센티미터 이상으로 할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 2항3호
check(REFB_15_2_3){
     IF CS THEN KS 
}

CS{
      getBuildingUsage()= "CulturalAndAssemblyFacility.PerformanceHall"
      OR getBuildingUsage()= "CulturalAndAssemblyFacility.AssemblyHall"
      OR getBuildingUsage()= "CulturalAndAssemblyFacility.Auditorium"
      OR getBuildingUsage()= "CommercialFacility "
}

KS{
     getObjectWidth(Stair)>=120 cm
     getObjectWidth(StairLanding)>=120 cm
}
 










def Check():
    for building in SELECT('building'):

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()
        min_clear_w = 0.6
        max_riser_h = 0.0
        min_tread_w = 0.0

        if bldg_use == '교육연구시설':
            min_clear_w = 1.5            
            min_tread_w = 0.26
            if sub_use == '초등학교':
                max_riser_h = 0.16
            elif sub_use in ['중학교', '고등학교']:
                max_riser_h = 0.18
        elif (bldg_use == '문화 및 집회시설' and sub_use in ['공연장', '집회장', '관람장']) or (bldg_use == '판매시설'):
            min_clear_w = 1.2
        else:
            min_clear_w = 0.6 
        
        for storey in building.SELECT('storey'):
            for stair in storey.SELECT('stair'):
                clear_width = stair.SELECT('clear width').UNIT('m')
                clear_w = clear_width.NUMBER()
                
                if clear_w < min_clear_w:
                    clear_width.ERROR('유효너비: ' + str(clear_w) + ' < ' + str(min_clear_w))
                else:
                    clear_width.SUCCESS('유효너비: ' + str(clear_w) + ' >= ' + str(min_clear_w))

                if max_riser_h > 0:
                    for riser_height in stair.SELECT('riser height'):
                        riser_h = riser_height.UNIT('m').NUMBER()

                        if riser_h > max_riser_h:
                            riser_height.ERROR('단높이: ' + str(riser_h) + ' > ' + str(max_riser_h))
                            break

                if min_tread_w > 0:
                    for tread_width in stair.SELECT('tread width'):
                        tread_w = tread_width.UNIT('m').NUMBER()

                        if tread_w < min_tread_w:
                            tread_width.ERROR('단너비: ' + str(tread_w) + ' < ' + str(min_tread_w))
                            break 





View
Modify
25
25269 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 2 항 4호

4. 윗층의 거실의 바닥면적의 합계가 200제곱미터 이상이거나 거실의 바닥면적의 합계가 100제곱미터 이상인 지하층의 계단인 경우에는 계단 및 계단참의 너비를 120센티미터 이상으로 할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 2항4호

check(REFB_15_2_4){

     IF CS THEN KS 

}



CS{  

   Floor myFloor{

   N=getFloorNumber(Stair)

   Floor.number=N+1

   }

   (getTotalFloorArea(myFloor.Room)>=200 m2 

   OR getTotalFloorArea(Room)>=100 m2)

    getFloorNumber(Stair)<0

      

}



KS{

       getObjectWidth(Stair)>=120 cm

      getObjectWidth(StairLanding)>120 cm

} 








area_sum_lable = '바닥면적 합계'
up_area_sum_lable = '윗층 바닥면적 합계'
clear_w_lable = '계단, 계단참의 유효면적'


def Check():
    area_sum =0
    up_area_sum = 0
    min_clear_w = 1.2
    under_stories = []

    for building in SELECT('building'):

        for storey in building.SELECT('storey'):
            if storey.SELECT('prop', '기준 지상층').BOOL():
                base_storey_exist = True
                break
            under_stories.append(storey)


        for storey in under_stories:
            if up_area_sum >= 200:
                continue

            else:
                for space in storey.SELECT('space'):
                    area_sum += space.SELECT('area').UNIT('m2').NUMBER()
                    if area_sum >= 100:
                        continue
                    else:
                        break
                    up_area_sum = area_sum

            for stair in storey.SELECT('stair'):

                clear_width = stair.SELECT('clear width').UNIT('m')
                clear_w = clear_width.NUMBER()

                if clear_w < min_clear_w:
                    clear_width.ERROR('유효너비: ' + str(clear_w) + ' < ' + str(min_clear_w))
                else:
                    clear_width.SUCCESS('유효너비: ' + str(clear_w) + ' >= ' + str(min_clear_w)) 





View
Modify
26
25270 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 2 항 5호

5. 기타의 계단인 경우에는 계단 및 계단참의 너비를 60센티미터 이상으로 할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 2항5호
check(REFB_15_2_5){
     KS
}


KS{
      getObjectWidth(Stair)>=120 cm
      getObjectWidth(StairLanding)>120 cm
} 










def Check():
    for building in SELECT('building'):

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()
        min_clear_w = 0.6
        max_riser_h = 0.0
        min_tread_w = 0.0

        if bldg_use == '교육연구시설':
            min_clear_w = 1.5            
            min_tread_w = 0.26
            if sub_use == '초등학교':
                max_riser_h = 0.16
            elif sub_use in ['중학교', '고등학교']:
                max_riser_h = 0.18
        elif (bldg_use == '문화 및 집회시설' and sub_use in ['공연장', '집회장', '관람장']) or (bldg_use == '판매시설'):
            min_clear_w = 1.2
        else:
            min_clear_w = 0.6 
        
        for storey in building.SELECT('storey'):
            for stair in storey.SELECT('stair'):
                clear_width = stair.SELECT('clear width').UNIT('m')
                clear_w = clear_width.NUMBER()
                
                if clear_w < min_clear_w:
                    clear_width.ERROR('유효너비: ' + str(clear_w) + ' < ' + str(min_clear_w))
                else:
                    clear_width.SUCCESS('유효너비: ' + str(clear_w) + ' >= ' + str(min_clear_w))

                if max_riser_h > 0:
                    for riser_height in stair.SELECT('riser height'):
                        riser_h = riser_height.UNIT('m').NUMBER()

                        if riser_h > max_riser_h:
                            riser_height.ERROR('단높이: ' + str(riser_h) + ' > ' + str(max_riser_h))
                            break

                if min_tread_w > 0:
                    for tread_width in stair.SELECT('tread width'):
                        tread_w = tread_width.UNIT('m').NUMBER()

                        if tread_w < min_tread_w:
                            tread_width.ERROR('단너비: ' + str(tread_w) + ' < ' + str(min_tread_w))
                            break 





View
Modify
27
25277 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 5 항

⑤계단을 대체하여 설치하는 경사로는 다음 각호의 기준에 적합하게 설치하여야 한다. <개정 2010.4.7>





건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 5항 
Check(REFB_15_5){     
IF CS THEN KS
}

CS{
isEixst(Ramp)=TRUE 
}
KS {
getResult(REFB_15_5_1)=TRUE
getResult(REFB_15_5_3)=TRUE
}

 








std_floor_area = 200
std_floor_area_label = '기준 연면적'
max_v = 1/8
max_v_label = '최대 경사도'

def Check():
    for building in SELECT('building'):

        for ramp in building.SELECT('ramp'):
            if ramp.SELECT('prop', '계단대체경사로').BOOL() == False:
                continue

            for change in ramp.SELECT('level change'):
                gradient = change.SELECT('gradient')
                g = gradient.NUMBER()

                if g > max_v:
                    gradient.ERROR('경사도: ' + str(g) + ' > ' + str(max_v))
                else:
                    gradient.SUCCESS('경사도: ' + str(g) + ' <= ' + str(max_v)) 





View
Modify
28
25278 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 5 항 1호

1. 경사도는 1 : 8을 넘지 아니할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 5항 1호 
Check(REFB_15_5_1){     
KS
}

KS{
getObjectGradient(Ramp) <= 12.5%
} 








std_floor_area = 200
std_floor_area_label = '기준 연면적'
max_v = 1/8
max_v_label = '최대 경사도'

def Check():
    for building in SELECT('building'):

        for ramp in building.SELECT('ramp'):
            if ramp.SELECT('prop', '계단대체경사로').BOOL() == False:
                continue

            for change in ramp.SELECT('level change'):
                gradient = change.SELECT('gradient')
                g = gradient.NUMBER()

                if g > max_v:
                    gradient.ERROR('경사도: ' + str(g) + ' > ' + str(max_v))
                else:
                    gradient.SUCCESS('경사도: ' + str(g) + ' <= ' + str(max_v)) 





View
Modify
29
25287 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조의2조 2 항 1호

1. 당해 층의 바닥면적의 합계가 500제곱미터 미만인 경우 1.5미터 이상





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조의2 (복도의 너비 및 설치기준) 2항1호
check(REFB_15-2_2_1){
     KS
}
KS{ 
     IF getTotalFloorArea(Corridor.Floor.Space)<500 m2
       THEN getObjectProperty(Corridor.effectiveWidth)>=1.5 m
     END IF 
     
}
 








corridor_code = '33105'
std_floor_area = 200

corridor_code_label = '복도 공간분류코드'
std_floor_area_label = '기준 연면적'

def Check():
    for building in SELECT('building'):
        if building.SELECT('prop', '연면적').NUMBER() <= std_floor_area:
            continue

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()
        if not ((bldg_use == '문화 및 집회시설' and sub_use in ['공연장' ,'집회장', '관람장', '전시장'])
            or (bldg_use == '종교시설' and sub_use == '종교집회장')
            or (bldg_use == '노유자시설' and sub_use in ['아동관련시설' ,'노인복지시설'])
            or (bldg_use == '수련시설' and sub_use == '생활권수련시설')
            or (bldg_use == '위락시설' and sub_use == '유흥주점')
            or (bldg_use == '장례시설' and sub_use == '장례식장')):
            continue

        for storey in building.SELECT('storey'):
            area = 0.0
            corridors = []
            for space in storey.SELECT('space'):
                if space.SELECT('class code').STRING() == corridor_code:
                    corridors.append(space)
                
                area += space.SELECT('area').UNIT('m2').NUMBER()
            
            min_cor_w = 1.8
            if area < 500:
                min_cor_w = 1.5
            elif area >= 1000:
                min_cor_w = 2.4

            for space in corridors:    
                width = space.SELECT('min clear width').UNIT('m')
                w = width.NUMBER()

                if w < min_cor_w:
                    width.ERROR('유효너비: ' + str(w) + ' < ' + str(min_cor_w))
                else:
                    width.SUCCESS('유효너비: ' + str(w) + ' >= ' + str(min_cor_w)) 





View
Modify
30
25288 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조의2조 2 항 2호

2. 당해 층의 바닥면적의 합계가 500제곱미터 이상 1천제곱미터 미만인 경우 1.8미터 이상





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조의2 (복도의 너비 및 설치기준) 2항2호
check(REFB_15-2_2_2){
     KS
}
KS{ 
    IF getTotalFloorArea(Corridor.Floor.Space)>=500 m2
       getTotalFloorArea(Corridor.Floor.Space)<1000 m2
         THEN getObjectProperty(Corridor.effectiveWidth)>=1.8 m
     END IF 
}


 








corridor_code = '33105'
std_floor_area = 200

corridor_code_label = '복도 공간분류코드'
std_floor_area_label = '기준 연면적'

def Check():
    for building in SELECT('building'):
        if building.SELECT('prop', '연면적').NUMBER() <= std_floor_area:
            continue

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()
        if not ((bldg_use == '문화 및 집회시설' and sub_use in ['공연장' ,'집회장', '관람장', '전시장'])
            or (bldg_use == '종교시설' and sub_use == '종교집회장')
            or (bldg_use == '노유자시설' and sub_use in ['아동관련시설' ,'노인복지시설'])
            or (bldg_use == '수련시설' and sub_use == '생활권수련시설')
            or (bldg_use == '위락시설' and sub_use == '유흥주점')
            or (bldg_use == '장례시설' and sub_use == '장례식장')):
            continue

        for storey in building.SELECT('storey'):
            area = 0.0
            corridors = []
            for space in storey.SELECT('space'):
                if space.SELECT('class code').STRING() == corridor_code:
                    corridors.append(space)
                
                area += space.SELECT('area').UNIT('m2').NUMBER()
            
            min_cor_w = 1.8
            if area < 500:
                min_cor_w = 1.5
            elif area >= 1000:
                min_cor_w = 2.4

            for space in corridors:    
                width = space.SELECT('min clear width').UNIT('m')
                w = width.NUMBER()

                if w < min_cor_w:
                    width.ERROR('유효너비: ' + str(w) + ' < ' + str(min_cor_w))
                else:
                    width.SUCCESS('유효너비: ' + str(w) + ' >= ' + str(min_cor_w)) 





View
Modify
31
25289 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조의2조 2 항 3호

3. 당해 층의 바닥면적의 합계가 1천제곱미터 이상인 경우 2.4미터 이상





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조의2 (복도의 너비 및 설치기준) 2항3호
Check(REFB_15-2_2_3){
     KS
}
KS{ 
     IF getTotalFloorArea(Corridor.Floor.Space)>=1000 m2
        THEN getObjectProperty(Corridor.effectiveWidth)>=2.4 m
     END IF
}


 








corridor_code = '33105'
std_floor_area = 200

corridor_code_label = '복도 공간분류코드'
std_floor_area_label = '기준 연면적'

def Check():
    for building in SELECT('building'):
        if building.SELECT('prop', '연면적').NUMBER() <= std_floor_area:
            continue

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()
        if not ((bldg_use == '문화 및 집회시설' and sub_use in ['공연장' ,'집회장', '관람장', '전시장'])
            or (bldg_use == '종교시설' and sub_use == '종교집회장')
            or (bldg_use == '노유자시설' and sub_use in ['아동관련시설' ,'노인복지시설'])
            or (bldg_use == '수련시설' and sub_use == '생활권수련시설')
            or (bldg_use == '위락시설' and sub_use == '유흥주점')
            or (bldg_use == '장례시설' and sub_use == '장례식장')):
            continue

        for storey in building.SELECT('storey'):
            area = 0.0
            corridors = []
            for space in storey.SELECT('space'):
                if space.SELECT('class code').STRING() == corridor_code:
                    corridors.append(space)
                
                area += space.SELECT('area').UNIT('m2').NUMBER()
            
            min_cor_w = 1.8
            if area < 500:
                min_cor_w = 1.5
            elif area >= 1000:
                min_cor_w = 2.4

            for space in corridors:    
                width = space.SELECT('min clear width').UNIT('m')
                w = width.NUMBER()

                if w < min_cor_w:
                    width.ERROR('유효너비: ' + str(w) + ' < ' + str(min_cor_w))
                else:
                    width.SUCCESS('유효너비: ' + str(w) + ' >= ' + str(min_cor_w)) 





View
Modify
32
25290 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조의2조 3 항

③문화 및 집회시설중 공연장에 설치하는 복도는 다음 각 호의 기준에 적합하여야 한다.





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조의2 (복도의 너비 및 설치기준) 3항
Check(REFB_15-2_3){
   IF CS THEN KS
}

CS{
   getSpaceUsage(Space)="CulturalAndAssemblyFacility.PerformanceHall"
   isExist(Corridor)=TRUE
}
KS{
    
     getResult(REFB_15-2_3_1) = TRUE
     getResult(REFB_15-2_3_2) = TRUE
} 








corridor_code = '33105'
theater_code = '00000'
std_floor_area = 200

corridor_code_label = '복도 공간분류코드'
theater_code_label = '관람석 공간분류코드'
std_floor_area_label = '기준 연면적'

def Check():
    for building in SELECT('building'):
        if building.SELECT('prop', '연면적').NUMBER() <= std_floor_area:
            continue

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()

        if not (bldg_use == '문화 및 집회시설' and sub_use == '공연장'):
            continue

        for storey in building.SELECT('storey'):
            for space in storey.SELECT('space'):
                if space.SELECT('class code').STRING() != theater_code:
                    continue
                
                area = space.SELECT('area').UNIT('m2').NUMBER()
                side_corridors = []
                fb_corridors = []

                for s in space.SELECT('side space'):
                    if s.SELECT('class code').STRING() == corridor_code:
                        side_corridors.append(s)

                for s in space.SELECT('front back space'):
                    if s.SELECT('class code').STRING() == corridor_code:
                        fb_corridors.append(s)

                if area >= 300:
                    if len(side_corridors) + len(fb_corridors) < 3:
                        space.ERROR('관람석의 양쪽과 뒤쪽 중 복도가 존재하지 않는 곳이 있습니다.')
                    else:
                        space.SUCCESS('관람석의 양쪽과 뒤쪽에 복도가 존재합니다.')
                else:
                    if len(side_corridors) == 2 or len(fb_corridors) == 2:
                        space.SUCCESS('관람석의 앞뒤쪽에 복도가 존재합니다.')
                    else:
                        space.ERROR('관람석의 앞뒤쪽 중 복도가 존재하지 않는 곳이 있습니다.') 





View
Modify
33
25291 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조의2조 3 항 1호

1. 공연장의 개별 관람석(바닥면적이 300제곱미터 이상인 경우에 한한다)의 바깥쪽에는 그 양쪽 및 뒤쪽에 각각 복도를 설치할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조의2 (복도의 너비 및 설치기준) 3항1호
Check(REFB_15-2_3_1){
  IF CS THEN KS
}

CS{
    Space mySpace{
       getSpaceUsage(Space)="IndividualAuditorium"
    }

    getFloorArea(mySpace)>300 m2
}

KS{

} 








corridor_code = '33105'
theater_code = '00000'
std_floor_area = 200

corridor_code_label = '복도 공간분류코드'
theater_code_label = '관람석 공간분류코드'
std_floor_area_label = '기준 연면적'

def Check():
    for building in SELECT('building'):
        if building.SELECT('prop', '연면적').NUMBER() <= std_floor_area:
            continue

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()

        if not (bldg_use == '문화 및 집회시설' and sub_use == '공연장'):
            continue

        for storey in building.SELECT('storey'):
            for space in storey.SELECT('space'):
                if space.SELECT('class code').STRING() != theater_code:
                    continue
                
                area = space.SELECT('area').UNIT('m2').NUMBER()
                side_corridors = []
                fb_corridors = []

                for s in space.SELECT('side space'):
                    if s.SELECT('class code').STRING() == corridor_code:
                        side_corridors.append(s)

                for s in space.SELECT('front back space'):
                    if s.SELECT('class code').STRING() == corridor_code:
                        fb_corridors.append(s)

                if area >= 300:
                    if len(side_corridors) + len(fb_corridors) < 3:
                        space.ERROR('관람석의 양쪽과 뒤쪽 중 복도가 존재하지 않는 곳이 있습니다.')
                    else:
                        space.SUCCESS('관람석의 양쪽과 뒤쪽에 복도가 존재합니다.')
                else:
                    if len(side_corridors) == 2 or len(fb_corridors) == 2:
                        space.SUCCESS('관람석의 앞뒤쪽에 복도가 존재합니다.')
                    else:
                        space.ERROR('관람석의 앞뒤쪽 중 복도가 존재하지 않는 곳이 있습니다.') 





View
Modify
34
25292 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조의2조 3 항 2호

2. 하나의 층에 개별 관람석(바닥면적이 300제곱미터 미만인 경우에 한한다)을 2개소 이상 연속하여 설치하는 경우에는 그 관람석의 바깥쪽의 앞쪽과 뒤쪽에 각각 복도를 설치할 것





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조의2 (복도의 너비 및 설치기준) 3항2호



Check(REFB_15-2_3_2){

  IF CS THEN KS

}







CS{

    Space mySpace{

       getSpaceUsage(Space)="IndividualAuditorium"

    }



    getFloorArea(mySpace)>300 m2

    getObjectCount(Floor.One.mySpace)>=2 



}



KS{



} 








corridor_code = '33105'
theater_code = '00000'
std_floor_area = 200

corridor_code_label = '복도 공간분류코드'
theater_code_label = '관람석 공간분류코드'
std_floor_area_label = '기준 연면적'

def Check():
    for building in SELECT('building'):
        if building.SELECT('prop', '연면적').NUMBER() <= std_floor_area:
            continue

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()

        if not (bldg_use == '문화 및 집회시설' and sub_use == '공연장'):
            continue

        for storey in building.SELECT('storey'):
            for space in storey.SELECT('space'):
                if space.SELECT('class code').STRING() != theater_code:
                    continue
                
                area = space.SELECT('area').UNIT('m2').NUMBER()
                side_corridors = []
                fb_corridors = []

                for s in space.SELECT('side space'):
                    if s.SELECT('class code').STRING() == corridor_code:
                        side_corridors.append(s)

                for s in space.SELECT('front back space'):
                    if s.SELECT('class code').STRING() == corridor_code:
                        fb_corridors.append(s)

                if area >= 300:
                    if len(side_corridors) + len(fb_corridors) < 3:
                        space.ERROR('관람석의 양쪽과 뒤쪽 중 복도가 존재하지 않는 곳이 있습니다.')
                    else:
                        space.SUCCESS('관람석의 양쪽과 뒤쪽에 복도가 존재합니다.')
                else:
                    if len(side_corridors) == 2 or len(fb_corridors) == 2:
                        space.SUCCESS('관람석의 앞뒤쪽에 복도가 존재합니다.')
                    else:
                        space.ERROR('관람석의 앞뒤쪽 중 복도가 존재하지 않는 곳이 있습니다.') 





View
Modify
35
25294 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 16조 1 항

①영 제50조의 규정에 의하여 설치하는 거실의 반자(반자가 없는 경우에는 보 또는 바로 윗층의 바닥판의 밑면 기타 이와 유사한 것을 말한다. 이하같다)는 그 높이를 2.1미터 이상으로 하여야 한다.





// 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 16조 (거실의 반자높이) 1항

check(REFB_16_1){

     IF (CS) THEN KS

}



CS{

     getResult(REFB_16_2) = FALSE

}



KS{

     getSpaceHeight(Room, b) >= 2.1m

} 








min_h = 2.1
min_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 in ['단독주택', '공동주택', '제1종 근린생활시설', '제2종 근린생활시설', '판매시설', '운수시설', '의료시설', '교육연구시설', '노유자시설', '수련시설', '운동시설', '업무시설', '숙박시설', '자동차 관련 시설', '교정 및 군사시설', '방송통신시설', '발전시설', '관광 휴게시설', '야영장 시설'])
                or (bldg_use == '위락시설' and sub_use != '유흥주점')):
            continue

        for space in building.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)) 





View
Modify
36
25295 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 16조 2 항

②문화 및 집회시설(전시장 및 동·식물원은 제외한다), 종교시설, 장례식장 또는 위락시설 중 유흥주점의 용도에 쓰이는 건축물의 관람석 또는 집회실로서 그 바닥면적이 200제곱미터 이상인 것의 반자의 높이는 제1항의 규정에 불구하고 4미터(노대의 아랫부분의 높이는 2.7미터)이상이어야 한다. 다만, 기계환기장치를 설치하는 경우에는 그러하지 아니하다. <개정 2010.4.7>





// 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 16조 (거실의 반자높이) 2항

check(REFB_16_2){

IF (CS1 AND CS2) THEN KS

}



CS1{



VentilatorEquipment myVentilatorEquipemnt{

isObjectProperty(VentilatorEquipment.isMechanical)=TRUE

}

	isExist(myVentilatorEquipemn) = FALSE 

}



CS2{

	Space mySpace{

		getSpaceUsage(Space) = “Auditorium”

		OR getSpaceUsage(Space) = “AssemblyHall”

	}



	((getBuildingUsage() = “CulturalAndAssemblyFacilities.Tavern”

	getBuildingUsage() != “ExhibitionHalls.Tavern”

	getBuildingUsage() != “ZoologicalAndBotanicalGardens.Tavern”)

	OR getBuildingUsage() = "ReligiousFacilities.Tavern” 








target_space_codes = ['33703', '33708']
min_h = 4.0
min_h_bal = 2.7
target_space_codes_label = '대상 공간분류코드'
min_h_label = '최소 반자 높이'
min_h_bal_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 not sub_use in ['전시장', '동물원', '식물원'])
                or (bldg_use in ['종교시설', '장례시설'])
                or (bldg_use == '위락시설' and sub_use == '유흥주점')):
            continue
        spaces = building.SELECT('space');

        for space in spaces:
            code = space.SELECT('class code').STRING()
            if not code in target_space_codes:
                continue
            area = space.SELECT('area').UNIT('m2').NUMBER()
            if area < 200:
                continue

            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))

        for space in spaces:
            if not '노대' in space.SELECT('name').STRING():
                continue
            for lower in space.SELECT('lower space'):
                code = lower.SELECT('class code').STRING()
                if not code in target_space_codes:
                    continue
                area = lower.SELECT('area').UNIT('m2').NUMBER()
                if area < 200:
                    continue
                pos = space.SELECT('center')
                dist = lower.SELECT('ceiling height', pos)
                height = dist.UNIT('m').NUMBER()
                if height < min_h_bal:
                    dist.ERROR('반자 높이 : ' + str(height) + ' < ' + str(min_h_bal))
                else:
                    dist.SUCCESS('반자 높이 : ' + str(height) + ' >= ' + str(min_h_bal)) 





View
Modify
37
25302 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 18조 1 항

①영 제52조의 규정에 의하여 건축물의 최하층에 있는 거실바닥의 높이는 지표면으로부터 45센티미터 이상으로 하여야 한다. 다만, 지표면을 콘크리트바닥으로 설치하는 등 방습을 위한 조치를 하는 경우에는 그러하지 아니하다.





// 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 18조 (거실등의 방습) 1항





Check(REFB_18_1){

IF !CS THEN KS}







KS{

 getObjectHeight(getFloor(BottomFloor))>=45CM

}





CS {

 isObjectProperty(Ground.Surface.isDampProof)=TRUE 

} 








// 변환중

Check():

KS{

    myFloors = getFloor(BottomFloor)
    for myFloor in myFloors:
        if getObjectHeight(myFloor)>= 4500:
            myFloor.SUCCESS("BottomFloor elevation:"+ str(getObjectHeight(myFloor))  + 'mm')
        else:
            myFloor.Fail("BottomFloor elevation:"+ str(getObjectHeight(myFloor))  + 'mm')


}


CS{

    isObjectProperty(Ground.Surface.isDampProof)=TRUE

}


getobjectheight(str objname):
    objheight = root.select(obj).height().unit('m').number()
    return objheight

def getfloor(floor):
    if type(floor) == int:
        floornum = floor
        myfloor = root.select('slab')
        myfloor = myfloor.select(floornum)
        return myfloor

    elif type(floor) == str:
        floorname = floor
        myfloor = root.select('slab')
        myfloor = myfloor.select(floorname)
        return myfloor 





View
Modify
38
25307 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 19조 1 항

①영 제53조의 규정에 의하여 건축물에 설치하는 경계벽 및 간막이벽은 내화구조로 하고, 지붕밑 또는 바로 윗층의 바닥판까지 닿게 하여야 한다.





check(REFB_19_1){

     KS

}



KS{

Wall myWall{
   isObjectProperty(Wall.isPartitionWall) = TRUE
}
Floor myFloor{
hasObject(Floor, myWall)
}
   isFireResistantStructure(myWall)=TRUE
(isConnectedTo(myWall, Roof.BottomSurface) = TRUE
 OR isCOnnectedTo(myWall, myFloor.UpperFloor.FloorSlab) = TRUE)

} 








def Check():
    for building in SELECT('building'):
        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()
        space_codes = []
        
        if bldg_use == '단독주택' and sub_use == '다가구주택':
            space_codes = ['가구'] #가구
        elif (bldg_use == '공동주택' and sub_use != '기숙사') or (bldg_use == '노유자시설' and sub_use == '노인복지주택'):
            space_codes = ['33237'] #세대
        elif bldg_use == '공동주택' and sub_use == '기숙사':
            space_codes = ['33230'] #침실
        elif bldg_use == '의료시설':
            space_codes = ['34310'] #병실
        elif bldg_use == '교육연구시설' and sub_use == '학교':
            space_codes = ['34404', '34409']    #교실
        elif bldg_use == '숙박시설':
            space_codes = ['33201'] #객실
        elif (bldg_use == '제2종 근린생활시설' and sub_use == '다중생활시설') or (bldg_use == '노유자시설' and sub_use == '노인요양시설'):
            space_codes = ['호실'] #호실
        else:
            return

        for storey in building.SELECT('storey'):
            walls_list = []
            for space in storey.SELECT('space'):
                code = space.SELECT('class code').STRING()
                if code in space_codes:
                    walls_list.append(space.SELECT('wall'))
            
            n = len(walls_list)
            for i, walls in enumerate(walls_list):
                if i == n-1:
                    break
                for j, walls2 in enumerate(walls_list):
                    if i >= j:
                        continue
                    for wall in walls:
                        if wall.SELECT('isexterior').BOOL():
                            continue
                        id = wall.SELECT('element id').STRING()
                        for wall2 in walls2:
                            if wall2.SELECT('isexterior').BOOL():
                                continue
                            id2 = wall2.SELECT('element id').STRING()
                            if id == id2:
                                if wall.SELECT('prop', '경계벽').BOOL() == False:
                                    wall.ERROR('해당 벽은 경계벽이어야 합니다.')
                                else:
                                    if wall.SELECT('prop', '내화구조').BOOL() == False:
                                        wall.ERROR('경계벽은 내화구조이어야 합니다.')
                                    else:
                                        if wall.SELECT('top touched').BOOL():
                                            wall.SUCCESS('경계벽 조건에 부합합니다.')
                                        else:
                                            wall.ERROR('경계벽 상단이 슬라브와 닿지 않습니다.')
                                break 





View
Modify
39
25503 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 7 항

⑦ 제1항 및 제2항에도 불구하고 영 제34조제4항 후단에 따라 피난층 또는 지상으로 통하는 직통계단을 설치하는 경우 계단 및 계단참의 너비는 다음 각 호의 구분에 따른 기준에 적합하여야 한다. <신설 2012.1.6>





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 7항
check(REFP_15_7){
     IF CS THEN KS
}

CS{

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

KS{
      getResult(REFP_15_7_1)
      OR getResult(REFP_15_7_2)
} 








min_stair_width = 1.5

def Check():
    for building in SELECT('building'):
        bldg_type = building.SELECT('building type').STRING()
        sub_type = building.SELECT('prop', '세부용도').STRING()

        if bldg_type is "공통주택":
            min_stair_width = 1.2
        else :
            min_stair_width = 1.5

        d_stairs = building.SELECT('direct stair')

        for d_stair in d_stairs:
            s_stair_w = d_stair.SELECT('width').Unit(m)

            breker = True
            for stair_stories in  d_stair.SELECT('storey'):
                if stair_stories.SELECT('is evacuation storey').BOOL() is True :
                    break
                elif stair_stories.SELECT('level') is "Ground" :
                    break
                else:
                    breaker = False
            if breaker is True:
                d_stair.SUCCESS('해당계단은 피난층이나 지상으로 통하는 직통계단이 아닙니다.')
                break
            if d_stair_w >= min_stair_width:
                d_stair.SUCCESS('계단의너비()' + d_stair_w + ')가 '  + '>=' + min_stair_width)
            else:
                d_stair.ERROR('계단의너비()' + d_stair_w + ')가 '  + '<' + min_stair_width)                
                
                 





View
Modify
40
25504 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 7 항 1호

1. 공동주택: 120센티미터 이상





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 7항 1호
check(REFP_15_7_1){
     KS
}

KS{
      getBuildingUsage() = "MultiUnitHouse"
      AND getStairStepWidth >= 1.2M
      AND getPaceWidth >= 1.2M
} 









min_stair_width = 1.5

def Check():
    for building in SELECT('building'):
        bldg_type = building.SELECT('building type').STRING()
        sub_type = building.SELECT('prop', '세부용도').STRING()

        if bldg_type is "공통주택":
            min_stair_width = 1.2
        else :
            min_stair_width = 1.5

        d_stairs = building.SELECT('direct stair')

        for d_stair in d_stairs:
            s_stair_w = d_stair.SELECT('width').Unit(m)

            breker = True
            for stair_stories in  d_stair.SELECT('storey'):
                if stair_stories.SELECT('is evacuation storey').BOOL() is True :
                    break
                elif stair_stories.SELECT('level') is "Ground" :
                    break
                else:
                    breaker = False
            if breaker is True:
                d_stair.SUCCESS('해당계단은 피난층이나 지상으로 통하는 직통계단이 아닙니다.')
                break
            if d_stair_w >= min_stair_width:
                d_stair.SUCCESS('계단의너비()' + d_stair_w + ')가 '  + '>=' + min_stair_width)
            else:
                d_stair.ERROR('계단의너비()' + d_stair_w + ')가 '  + '<' + min_stair_width)                
                
                 





View
Modify
41
25505 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조 7 항 2호

2. 공동주택이 아닌 건축물: 150센티미터 이상





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조 (계단의 설치기준) 7항 2호
check(REFP_15_7_2){
     KS
}

KS{
      getBuildingUsage() != "MultiUnitHouse"
      AND getStairStepWidth >= 1.5M
      AND getPaceWidth >= 1.5M
} 









min_stair_width = 1.5

def Check():
    for building in SELECT('building'):
        bldg_type = building.SELECT('building type').STRING()
        sub_type = building.SELECT('prop', '세부용도').STRING()

        if bldg_type is "공통주택":
            min_stair_width = 1.2
        else :
            min_stair_width = 1.5

        d_stairs = building.SELECT('direct stair')

        for d_stair in d_stairs:
            s_stair_w = d_stair.SELECT('width').Unit(m)

            breker = True
            for stair_stories in  d_stair.SELECT('storey'):
                if stair_stories.SELECT('is evacuation storey').BOOL() is True :
                    break
                elif stair_stories.SELECT('level') is "Ground" :
                    break
                else:
                    breaker = False
            if breaker is True:
                d_stair.SUCCESS('해당계단은 피난층이나 지상으로 통하는 직통계단이 아닙니다.')
                break
            if d_stair_w >= min_stair_width:
                d_stair.SUCCESS('계단의너비()' + d_stair_w + ')가 '  + '>=' + min_stair_width)
            else:
                d_stair.ERROR('계단의너비()' + d_stair_w + ')가 '  + '<' + min_stair_width)                
                
                 





View
Modify
42
25611 건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 제 15조의2조 2 항

②문화 및 집회시설(공연장ㆍ집회장ㆍ관람장ㆍ전시장에 한한다), 종교시설 중 종교집회장, 노유자시설 중 아동 관련 시설ㆍ노인복지시설, 수련시설 중 생활권수련시설, 위락시설 중 유흥주점 및 장례식장의 관람석 또는 집회실과 접하는 복도의 유효너비는 제1항의 규정에 불구하고 다음 각 호에서 정하는 너비로 하여야 한다. <개정 2010.4.7>





//건축물의 피난ㆍ방화구조 등의 기준에 관한 규칙 15조의2 (복도의 너비 및 설치기준) 2항

check(REFB_15-2_2){

     IF CS THEN KS 

}



CS{

Space  mySpace{

getSpaceUsage(Space) = “AssemblyHall”

OR getSpaceUsage(Space) = “PerformanceHall”

}

    Corridor myCorridor{

       isAdjacent(mySpace,Corridor) = TRUE

    }



    (getBuildingUsage()="CulturalAndAssemblyFacility.PerformanceHall"

    OR getBuildingUsage()="CulturalAndAssemblyFacility.AssemblyHall"

    OR getBuildingUsage()="CulturalAndAssemblyFacility.Auditorium"

    OR getBuildingUsage()="CulturalAndAssemblyFacility.ExhibitionHall"

    OR getBuildingUsage()="ReligiousFacility.ReligiousAssemblyFacility"

    OR getBuildingUsage()="FacilitiesForTheAgedAndChildren.ChildrenRelatedFacility"

    OR getBuildingUsage()="FacilitiesForTheAgedAndChildren.WelfareFacilityForTheAged"

    OR getBuildingUsage()="Trainingfacility.TrainingFacilitiesInLiving "

    OR getBuildingUsage()="AmusementFacility.tavern"

    OR getBuildingUsage()="AmusementFacility.FuneralParlors" )

     

    isExist(myCorridor)=TRUE   

}



KS{



 

   getResult(REFB_15-2_2_1)=TRUE

   getResult(REFB_15-2_2_2)=TRUE

   getResult(REFB_15-2_2_3)=TRUE

} 








corridor_code = '33105'
std_floor_area = 200

corridor_code_label = '복도 공간분류코드'
std_floor_area_label = '기준 연면적'

def Check():
    for building in SELECT('building'):
        if building.SELECT('prop', '연면적').NUMBER() <= std_floor_area:
            continue

        bldg_use = building.SELECT('building type').STRING()
        sub_use = building.SELECT('prop', '세부용도').STRING()
        if not ((bldg_use == '문화 및 집회시설' and sub_use in ['공연장' ,'집회장', '관람장', '전시장'])
            or (bldg_use == '종교시설' and sub_use == '종교집회장')
            or (bldg_use == '노유자시설' and sub_use in ['아동관련시설' ,'노인복지시설'])
            or (bldg_use == '수련시설' and sub_use == '생활권수련시설')
            or (bldg_use == '위락시설' and sub_use == '유흥주점')
            or (bldg_use == '장례시설' and sub_use == '장례식장')):
            continue

        for storey in building.SELECT('storey'):
            area = 0.0
            corridors = []
            for space in storey.SELECT('space'):
                if space.SELECT('class code').STRING() == corridor_code:
                    corridors.append(space)
                
                area += space.SELECT('area').UNIT('m2').NUMBER()
            
            min_cor_w = 1.8
            if area < 500:
                min_cor_w = 1.5
            elif area >= 1000:
                min_cor_w = 2.4

            for space in corridors:    
                width = space.SELECT('min clear width').UNIT('m')
                w = width.NUMBER()

                if w < min_cor_w:
                    width.ERROR('유효너비: ' + str(w) + ' < ' + str(min_cor_w))
                else:
                    width.SUCCESS('유효너비: ' + str(w) + ' >= ' + str(min_cor_w)) 





View
Modify
43
32206 건축법 시행령 제 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) + ')')
 





View
Modify
44
32211 건축법 시행령 제 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) + ')')
 





View
Modify
45
33160 건축법 시행령 제 41조 1 항 1호

1. 통로의 너비는 다음 각 목의 구분에 따른 기준에 따라 확보할 것





Check(EDBA_41_1_1){

getresult(EDBA_41_1_1_가) =True 
getresult(EDBA_41_1_1_나) =True 
getresult(EDBA_41_1_1_다) =True 
} 








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)) 





View
Modify
46
33161 건축법 시행령 제 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")
 





View
Modify
47
33163 건축법 시행령 제 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)) 





View
Modify
48
34605 건축법 시행령 제 41조 1 항

①건축물의 대지 안에는 그 건축물 바깥쪽으로 통하는 주된 출구와 지상으로 통하는 피난계단 및 특별피난계단으로부터 도로 또는 공지(공원, 광장, 그 밖에 이와 비슷한 것으로서 피난 및 소화를 위하여 해당 대지의 출입에 지장이 없는 것을 말한다. 이하 이 조에서 같다)로 통하는 통로를 다음 각 호의 기준에 따라 설치하여야 한다. <개정 2010.12.13, 2015.9.22, 2016.5.17, 2017.2.3>





Check(EDBA_41_1){

    KS

}







KS{



   Door  myDoor {
getObjectProperty(Door.functionType) = "Main"
   }

   Stair myStair{
isAccessible(Stair, Ground) = TRUE
isObjectProperty(Stair.isEscape) = TRUE

       OR isObjectProperty(Stair.isSpecialEscape) = TRUE



   }

   Passage  myPassage{

       isGoThrough(myStair, Road, Passage)=True

       OR isGoThrough(myStair, OpenSpace, Passage )=True

   }



   isExist(myDoor)=True

   isExist(myPassage)=True

   getResult(EDBA_41_1_1)=True

   getResult(EDBA_41_1_2)=True

   getResult(EDBA_41_1_3)=True

} 








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)) 





View
Modify
49
34608 건축법 시행령 제 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)) 





View
Modify
50
35549 건축법 시행령 제 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") 
 





View
Modify
51
35870 건축법 시행령 제 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) + ')')
 





View
Modify
52
36283 건축법 시행령 제 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")  





View
Modify
53
36284 건축법 시행령 제 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")  





View
Modify
54
36579 건축법 시행령 제 35조 1 항 1호

1. 5층 이상인 층의 바닥면적의 합계가 200제곱미터 이하인 경우





//건축법 시행령 35조(피난계단의 설치) 1항1호

Check(EDBA_35_1_1){
	KS
}



KS { 
	Floor myFloor { 
	getObjectProperty(Floor.number) >= 5 
	} 

	getTotalFloorArea(myFloor) <= 200m2 

} 








min_floor_area = 200
min_floor_area_label = "Minimum total floor area"

def Check():
    num = 0
    for storey in SELECT('storey'):
        if num >= 5:
            area_sum = 0
            for space in storey.SELECT('space'):      
                area_sum += space.SELECT('area').UNIT('m2').NUMBER() 
            if area_sum >= min_floor_area:
                storey.SUCCESS("Total floor area:"+ str(area_sum)  + 'm2')
            else:
                storey.FAIL("Total floor area:"+ str(area_sum) + 'm2')
        num += 1 





View
Modify
55
36587 건축법 시행령 제 37조

제37조 (지하층과 피난층 사이의 개방공간 설치) 바닥면적의 합계가 3천 제곱미터 이상인 공연장·집회장·관람장 또는 전시장을 지하층에 설치하는 경우에는 각 실에 있는 자가 지하층 각 층에서 건축물 밖으로 피난하여 옥외 계단 또는 경사로 등을 이용하여 피난층으로 대피할 수 있도록 천장이 개방된 외부 공간을 설치하여야 한다.





Check(EDBA_37){

  IF (CS) THEN KS END IF

  Space mySpace{

        Space.Floor.area > 3000 M2;

        Space.usage="PerformanceHall"

        OR Space.usage="AssemblyHall"

        OR Space.usage="Auditorium"

        OR Space.usage="ExhibitionHall"

  }

}



CS{

    

    mySpace.Floor.number< 0 

    

}



KS{

Stair myStair{
Stair.isOutdoor = TRUE
}
Floor myFloor{
Floor.isEscape = TRUE
}
Space mySpace{
hasObject(Space, Ceiling) != TRUE
}
     (isGoThrough(mySpace, myStair, myFloor)=True

     OR isGoThrough(mySpace, Ramp, myFloor)=True)

     AND isExternal(mySpace)=True

    

} 








std_area = 3000
std_area_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 in ['공연장', '집회장', '관람장', '전시장']):
            continue

        base_storey_exist = False
        under_stories = []

        for storey in building.SELECT('storey'):
            if storey.SELECT('prop', '기준 지상층').BOOL():
                base_storey_exist = True
                break
            under_stories.append(storey)

        if base_storey_exist == False:
            building.ERROR('지상층이 존재하지 않습니다.')
            continue

        if len(under_stories) == 0:
            continue

        area_sum = 0.0
        ex_spaces = []

        for storey in under_stories:
            for space in storey.SELECT('space'):
                area_sum += space.SELECT('area').UNIT('m2').NUMBER()
                if space.SELECT('is external').BOOL():
                    ex_spaces.append(space)

        if area_sum < std_area:
            building.SUCCESS('지하공간 바닥면적 합: ' + str(area_sum) + ' < ' + str(std_area))
            continue

        if len(ex_spaces) == 0:
            building.ERROR('지하에 천장이 개방된 외부 공간이 없습니다.')
            continue

        for space in ex_spaces:
            for stair in space.SELECT('stair'):
                if stair.SELECT('is direct').BOOL():
                    space.SUCCESS('피난층으로 대피할 수 있는 외부 공간이 존재합니다.')
                    return

        ex_spaces[0].ERROR('피난층으로 대피할 수 없습니다.') 





View
Modify
56
36588 건축법 시행령 제 38조

제38조 (관람석 등으로부터의 출구 설치) 법 제49조제1항에 따라 다음 각 호의 어느 하나에 해당하는 건축물에는 국토해양부령으로 정하는 기준에 따라 관람석 또는 집회실로부터의 출구를 설치하여야 한다.





//건축법 시행령 38조(관람석 등으로부터의 출구 설치)

Check(EDBA_38){

  IF (CS) THEN  KS ENDIF

}



CS{

    getResult(EDBA_38_0_1) = TRUE

    OR getResult(EDBA_38_0_2) = TRUE

    OR getResult(EDBA_38_0_3) = TRUE

    OR getResult(EDBA_38_0_4) = TRUE

    OR getResult(EDBA_38_0_5) = TRUE

}



KS {

    Space mySpace = getSpace("Auditorium")+getSpace("AssemblyHall")



    Door myExit {

        isObjectProperty(Door.isEntrance) = TRUE

        isAccessible(mySpace, Door) = TRUE

        getResult(REFB_10_1) = TRUE

    }



    hasElement(mySpace, myExit)=TRUE 

} 








identified_space_codes =['33703', '33708']
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) + '㎡)') 





View
Modify
57
36590 건축법 시행령 제 39조 1 항

① 법 제49조제1항에 따라 다음 각 호의 어느 하나에 해당하는 건축물에는 국토해양부령으로 정하는 기준에 따라 그 건축물로부터 바깥쪽으로 나가는 출구를 설치하여야 한다.





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

Check(EDBA_39_1){     
IF  CS THEN KS
}

CS {
getResult(EDBA_39_1_1) = TRUE
OR getResult(EDBA_39_1_2) = TRUE
OR getResult(EDBA_39_1_3) = TRUE
OR getResult(EDBA_39_1_4) = TRUE
OR getResult(EDBA_39_1_5) = TRUE
OR getResult(EDBA_39_1_6) = TRUE
OR getResult(EDBA_39_1_7) = TRUE
OR getResult(EDBA_39_1_8) = TRUE
OR getResult(EDBA_39_1_9) = TRUE
OR getResult(EDBA_39_1_10) = TRUE
}

KS {
Door myDoor{
 isObjectProperty(Door.isEntrance)=TRUE
}

isExist(myDoor)=TRUE

getResult(REFB_11_1)=TRUE
getResult(REFB_11_2)=TRUE
getResult(REFB_11_3)=TRUE
getResult(REFB_11_4)=TRUE
getResult(REFB_11_5)=TRUE
getResult(REFB_11_6)=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) + ')')
 





View
Modify
58
36591 건축법 시행령 제 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) + ')')
 





View
Modify
59
36592 건축법 시행령 제 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) + ')')
 





View
Modify
60
36593 건축법 시행령 제 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) + ')')
 





View
Modify
61
36594 건축법 시행령 제 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) + ')')
 





View
Modify
62
36596 건축법 시행령 제 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) + ')')
 





View
Modify
63
36598 건축법 시행령 제 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) + ')')
 





View
Modify
64
36599 건축법 시행령 제 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) + ')')
 





View
Modify
65
36602 건축법 시행령 제 40조 1 항

① 옥상광장 또는 2층 이상인 층에 있는 노대(露臺)나 그 밖에 이와 비슷한 것의 주위에는 높이 1.2미터 이상의 난간을 설치하여야 한다. 다만, 그 노대 등에 출입할 수 없는 구조인 경우에는 그러하지 아니하다.





//건축법 시행령 40조 (옥상광장 등의 설치) 1항

check(EDBA_40_1){

	IF (CS) THEN KS

}



CS{

	Space myBalcony {

		getSpace(“Balconly”)

		Space.Floor.number >= 2

	}



	Space mySpace{

		getSpace(“RoofTopPlaza”) + getSpace(myBalcony)

	}



	isAccessible(mySpace) = TRUE

}



KS{

	hasElement(mySpace, Railing) = TRUE

	mySpace.Rail.height >= 1.2m

} 








target_space_names = ['옥상광장', '노대']
drop_h = 2.0
barrier_h = 1.2

target_space_names_label = '대상 공간 이름'
drop_h_label = '최소 추락 높이'
barrier_h_label = '최소 난간 높이'

def Check():
    for space in SELECT('space'):
        if space.SELECT('is name in', target_space_names).BOOL() == False:
            continue
        if space.SELECT('space door').COUNT() + space.SELECT('opening').COUNT() == 0:
            space.SUCCESS('출입 불가능')
            continue

        for edge in space.SELECT('edge'):
            drop = edge.SELECT('drop').UNIT('m')
            if drop.COUNT() == 0 or drop.LTE(drop_h): 
                continue

            safetybarrier = edge.SELECT('safety barrier')   
            if safetybarrier.COUNT() == 0 : 
                drop.ERROR('난간 미설치')
                continue
                    
            height = safetybarrier.SELECT('height').UNIT('m')
            height_val = height.NUMBER()
                
            if height_val < barrier_h:
                height.ERROR('난간 높이: ' +  str(height_val) + ' < ' + str(barrier_h))
            else:
                height.SUCCESS('난간 높이: ' +  str(height_val) + ' >= ' + str(barrier_h)) 





View
Modify
66
36630 건축법 시행령 제 48조 1 항

① 법 제49조제2항에 따라 연면적 200제곱미터를 초과하는 건축물에 설치하는 계단 및 복도는 국토해양부령으로 정하는 기준에 적합하여야 한다.





//건축법 시행령 48조 (계단ㆍ복도 및 출입구의 설치) 1항

Check(EDBA_48_1){
     IF CS THEN KS 
}

CS{
   getGrossFloorArea()>200 m2
}

KS{
   getResult(REFB_15_1)=True
   getResult(REFB_15_1_1)=True
   getResult(REFB_15_1_2)=True
   getResult(REFB_15_1_3)=True
   getResult(REFB_15_1_4)=True

   getResult(REFB_15_2)=True
   getResult(REFB_15_2_1)=True
   getResult(REFB_15_2_2)=True
   getResult(REFB_15_2_3)=True
   getResult(REFB_15_2_4)=True
   getResult(REFB_15_2_5)=True
   getResult(REFB_15_2_6)=True

   getResult(REFB_15-2_1)=True
   getResult(REFB_15-2_2)=True
   getResult(REFB_15-2_2_1)=True
   getResult(REFB_15-2_2_2)=True
   getResult(REFB_15-2_2_3)=True

   getResult(REFB_15-2_3)=True
   getResult(REFB_15-2_3_1)=True
   getResult(REFB_15-2_3_2)=True
} 









std_floor_area = 200



std_floor_area_label = '기준 연면면적'

def Check():
    for building in SELECT('building'):
        if building.SELECT('area').Unit(m2).NUmber() < 200:
            continue
                         





View
Modify
67
36631 건축법 시행령 제 48조 2 항

② 법 제49조제2항에 따라 제39조제1항 각 호의 어느 하나에 해당하는 건축물의 출입구는 국토해양부령으로 정하는 기준에 적합하여야 한다.





//건축법 시행령 48조 (계단ㆍ복도 및 출입구의 설치)2항

Check(EDBA_48_2){
     IF CS THEN KS 
}

CS{
    getResult(EDBA_39_1_1)=True
    OR  getResult(EDBA_39_1_2)=True
    OR  getResult(EDBA_39_1_3)=True
    OR  getResult(EDBA_39_1_4)=True
    OR  getResult(EDBA_39_1_5)=True
    OR  getResult(EDBA_39_1_6)=True
    OR  getResult(EDBA_39_1_7)=True
    OR  getResult(EDBA_39_1_8)=True
    OR  getResult(EDBA_39_1_9)=True
    OR  getResult(EDBA_39_1_10)=True
}

KS{
   getResult(REFB_11_1)=True
   getResult(REFB_11_2)=True
   getResult(REFB_11_3)=True
   getResult(REFB_11_4)=True
   getResult(REFB_11_5)=True
   getResult(REFB_11_6)=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) + ')')
 





View
Modify
68
36632 건축법 시행령 제 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)) 





View
Modify
69
36634 건축법 시행령 제 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) + ', 공기조화설비 미설치') 





View
Modify
70
36872 건축법 시행령 제 119조 1 항 7호

7. 반자높이: 방의 바닥면으로부터 반자까지의 높이로 한다. 다만, 한 방에서 반자높이가 다른 부분이 있는 경우에는 그 각 부분의 반자면적에 따라 가중평균한 높이로 한다.





//

check() {

getobjectproperty(CeilingCovering.height)

} 








def Check():
    for building in SELECT('building'):
        for space in building.SELECT('space'):
            dist = space.SELECT('ceiling height')
            height = dist.UNIT('m').NUMBER()
            return height 





View
Modify
71
37352 건축법 시행령 제 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)) 





View
Modify
72
37385 건축법 시행령 제 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('난간이 존재하지 않습니다.') 





View
Modify
73
61081 주차장법 시행규칙 제 3조 1 항

① 법 제6조제1항에 따른 주차장의 주차단위구획은 다음 각 호와 같다.





//	주차장법 시행규칙 3조 (주차장의 주차구획) 1항
Check(ERPA_3_1){
	KS
}

KS{
	getResult(ERPA_3_1_1) = TRUE
	getResult(ERPA_3_1_2) = TRUE
}
 








def Check():
    for parklot in ROOT.SELECT('parklot'):
        park_type = parklot.SELECT('prop', '주차형식').STRING()
        car_type = parklot.SELECT('prop', '주차단위구획').STRING()
        min_w = 0.0
        min_l = 0.0

        if park_type == '평행주차':
            if car_type == '경형':
                min_w = 1.7
                min_l = 4.5
            elif car_type == '일반형':
                min_w = 2.0
                min_l = 6.0
            elif car_type == '이륜자동차전용':
                min_w = 1.0
                min_l = 2.3
            else:
                continue
        else:
            if car_type == '경형':
                min_w = 2.0
                min_l = 3.6
            elif car_type == '일반형':
                min_w = 2.5
                min_l = 5.0
            elif car_type == '확장형':
                min_w = 2.6
                min_l = 5.2
            elif car_type == '장애인전용':
                min_w = 3.3
                min_l = 5.0
            elif car_type == '이륜자동차전용':
                min_w = 1.0
                min_l = 2.3
            else:
                continue

        width = parklot.SELECT('width').UNIT('m')
        length = parklot.SELECT('length').UNIT('m')
        w = width.NUMBER()  
        l = length.NUMBER()

        if w < min_w:
            width.ERROR('너비: ' + str(w) + ' (< ' + str(min_w) + ')' ) 
        elif l < min_l:
            length.ERROR('길이: ' + str(l) + ' (< ' + str(min_l) + ')' ) 
        else:
            parklot.SUCCESS(str(w) + ' x ' + str(l)) 





View
Modify
74
61512 주차장법 시행규칙 제 3조 1 항 1호

1. 평행주차형식의 경우 img24335428 ┌───────────┬──────┬──────┐ │구분 │너비 │길이 │ ├───────────┼──────┼──────┤ │경형 │1.7미터 이상│4.5미터 이상│ ├───────────┼──────┼──────┤ │일반형 │2.0미터 이상│6.0미터 이상│ ├───────────┼──────┼──────┤ │보도와 차도의 구분이 │2.0미터 이상│5.0미터 이상│ │없는 주거지역의 도로 │ │ │ ├───────────┼──────┼──────┤ │이륜자동차전용 │1.0미터 이상│2.3미터 이상│ └───────────┴──────┴──────┘





//  주차장법 시행규칙 3조 (주차장의 주차구획) 1항 1호
Check(ERPA_3_1_1){
	KS
}

KS{
	getObjectProperty(ParkingUnit.parkingType) = "ParallelParking"
}
 








def Check():
    for parklot in ROOT.SELECT('parklot'):
        park_type = parklot.SELECT('prop', '주차형식').STRING()
        car_type = parklot.SELECT('prop', '주차단위구획').STRING()
        min_w = 0.0
        min_l = 0.0

        if park_type == '평행주차':
            if car_type == '경형':
                min_w = 1.7
                min_l = 4.5
            elif car_type == '일반형':
                min_w = 2.0
                min_l = 6.0
            elif car_type == '이륜자동차전용':
                min_w = 1.0
                min_l = 2.3
            else:
                continue
        else:
            if car_type == '경형':
                min_w = 2.0
                min_l = 3.6
            elif car_type == '일반형':
                min_w = 2.5
                min_l = 5.0
            elif car_type == '확장형':
                min_w = 2.6
                min_l = 5.2
            elif car_type == '장애인전용':
                min_w = 3.3
                min_l = 5.0
            elif car_type == '이륜자동차전용':
                min_w = 1.0
                min_l = 2.3
            else:
                continue

        width = parklot.SELECT('width').UNIT('m')
        length = parklot.SELECT('length').UNIT('m')
        w = width.NUMBER()  
        l = length.NUMBER()

        if w < min_w:
            width.ERROR('너비: ' + str(w) + ' (< ' + str(min_w) + ')' ) 
        elif l < min_l:
            length.ERROR('길이: ' + str(l) + ' (< ' + str(min_l) + ')' ) 
        else:
            parklot.SUCCESS(str(w) + ' x ' + str(l)) 





View
Modify
75
61513 주차장법 시행규칙 제 3조 1 항 2호

2. 평행주차형식 외의 경우 img33758907 ┌────────┬──────┬──────┐ │구분 │너비 │길이 │ ├────────┼──────┼──────┤ │경형 │2.0미터 이상│3.6미터 이상│ ├────────┼──────┼──────┤ │일반형 │2.5미터 이상│5.0미터 이상│ ├────────┼──────┼──────┤ │확장형 │2.6미터 이상│5.2미터 이상│ ├────────┼──────┼──────┤ │장애인전용 │3.3미터 이상│5.0미터 이상│ ├────────┼──────┼──────┤ │이륜자동차 전용 │1.0미터 이상│2.3미터 이상│ └────────┴──────┴──────┘





//  주차장법 시행규칙 3조 (주차장의 주차구획) 1항 2호
Check(ERPA_3_1_2){
	KS
}

KS{
	getObjectProperty(ParkingUnit.parkingType) != "ParallelParking"
} 








def Check():
    for parklot in ROOT.SELECT('parklot'):
        park_type = parklot.SELECT('prop', '주차형식').STRING()
        car_type = parklot.SELECT('prop', '주차단위구획').STRING()
        min_w = 0.0
        min_l = 0.0

        if park_type == '평행주차':
            if car_type == '경형':
                min_w = 1.7
                min_l = 4.5
            elif car_type == '일반형':
                min_w = 2.0
                min_l = 6.0
            elif car_type == '이륜자동차전용':
                min_w = 1.0
                min_l = 2.3
            else:
                continue
        else:
            if car_type == '경형':
                min_w = 2.0
                min_l = 3.6
            elif car_type == '일반형':
                min_w = 2.5
                min_l = 5.0
            elif car_type == '확장형':
                min_w = 2.6
                min_l = 5.2
            elif car_type == '장애인전용':
                min_w = 3.3
                min_l = 5.0
            elif car_type == '이륜자동차전용':
                min_w = 1.0
                min_l = 2.3
            else:
                continue

        width = parklot.SELECT('width').UNIT('m')
        length = parklot.SELECT('length').UNIT('m')
        w = width.NUMBER()  
        l = length.NUMBER()

        if w < min_w:
            width.ERROR('너비: ' + str(w) + ' (< ' + str(min_w) + ')' ) 
        elif l < min_l:
            length.ERROR('길이: ' + str(l) + ' (< ' + str(min_l) + ')' ) 
        else:
            parklot.SUCCESS(str(w) + ' x ' + str(l)) 





View
Modify
76
71621 건축법 시행령 제 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") 





View
Modify
77
71622 건축법 시행령 제 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") 
 





View
Modify
78
71631 건축법 시행령 제 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) + '㎡)') 





View
Modify
79
71632 건축법 시행령 제 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) + '㎡)') 





View
Modify
    1      
 

Related Sites

국토부 BIM과제-1st  |   Ministry of Land, Infrasrtucture and Transport   |   Korea Agency for Infrastructure Technology Advancement  |   Space and Design IT Lab   |   Yonsei University
This is Design IT Lab server's restricted area. Authorized users could access this website.