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