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 /// def getFloor(spc): if type(spc) == str: building = ROOT.SELECT('building') storey = building.SELECT('storey') spc = storey.SELECT(spc) else: continue return spc
def getStair(Stair): if type(Stair) == str: StairName = Stair myStair = ROOT.SELECT('stair') myStair = myStair.SELECT(StairName) return myStair /// def getStair(elm): if type(elm) == str: stair = ROOT.SELECT('stair) elm = stair.SELECT(elm) else: continue return elm
def isExist(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else : continue if myObject.COUNT() == 0: return False else: return True
def getObjectCount(Object, HostingObject=None): if HostingObject != None: myHostingObject = ROOT.SELECT(HostingObject) myObjectCount = myHostingObject.SELECT(Object).COUNT() return myObjectCount else: myObjectCount = ROOT.SELECT(Object).COUNT() return myObjectCount /// def getObjectCount(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else : continue objCount = obj.COUNT() return objCount
def getBuildingStoriesCount(BuildingName=None): StoreyNum = 1 if BuildingName != None: myBuilding = ROOT.SELECT(BuildingName) TotalStorey = myBuilding .SELECT('storey') for Stoery in TotalStorey: if Stoery.SELECT('Elevation') < 0: pass else: StoreyNum += 1 return StoreyNum else: TotalStorey = ROOT.SELECT('storey') for Stoery in TotalStorey: if Stoery.SELECT('Elevation') < 0: pass else: StoreyNum += 1 return StoreyNum
def getParkingLotsCount(Object, HostingObject=None): if HostingObject != None: myHostingObject = ROOT.SELECT(HostingObject) myObjectCount = myHostingObject.SELECT(Object).COUNT() return myObjectCount else: myObjectCount = ROOT.SELECT(Object).COUNT() return myObjectCount /// def getParkingLotsCount(obj): parklot = ROOT.SELECT('parklot') if obj == None: obj = parklot elif type(obj) == str: obj = parklot.SELECT(obj) else: continue parklotCount = obj.COUNT() return parklotCount
def getObjectProperty(str ObjName, str PropName): myObj = ROOT.SELECT(ObjName) MyProp = myObj.SELECT(PropName) return myProp /// def getObjectPropoerty(obj, property): if type(obj) == str: obj = ROOT.SELECT(obj) else : continue objProperty = obj.SELECT(property) return objProperty
def getObjectType(obj); if type(obj) == str: obj = ROOT.SELECT(obj) else: continue objType = obj.SELECT(type).STRING() return objType
def getFloorType(obj): if type(obj) == str: building = ROOT.SELECT('building') storey = building.SELECT('storey') obj = storey.SELECT(obj) else : continue floorType = obj.SELECT(type).STRING() return floorType
def getStairType(obj); if type(obj) == str: building = ROOT.SELECT('building') stair = building.SELECT('stair') obj = stair.SELECT('obj') else: continue stairType = obj.SELECT('type').STRING() return stairType
def getDoorType(obj); if type(obj) == str: building = ROOT.SELECT('building') space = building.SELECT('space') door = space.SELECT('door') obj = door.SELECT(obj) else: continue doorType = obj.SELECT('type').STRING() return doorType
def getObjectUsage(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue objUsage = obj.SELECT('prop', '세부용도').STRING() return objUsage
def getBuildingUsage(building): if building != None: building = ROOT.SELECT('building') building = building.SELECT(building) else: building = ROOT.SELECT('building') buildingUsage = obj.SELECT('prop', '세부용도').STRING() return buildingUsage
def getFloorUsage(obj): if type(obj) == str: building = ROOT.SELECT('building') storey = building.SELECT('storey') obj = storey.SELECT(obj) else: continue floorUsage = obj.SELECT('prop', '세부용도').STRING() return floorUsage
def getSpaceUsage(obj): if type(obj) == str: building = ROOT.SELECT('building') space = building.SELECT('space') obj = space.SELECT(obj) else: continue spaceUsage = obj.SELECT('prop', '세부용도').STRING() return spaceUsage
def getSiteUsage(siteName = None): if siteName != None: site = ROOT.SELECT('site') site = site.SELECT(siteName) else: site = ROOT.SELECT('site') siteUsage = site.SELECT('prop', '세부용도').STRING() return siteUsage
def getObjectMaterial(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue objMaterial = obj.SELECT('material').STRING() return objMaterial
def getFloorNumber(obj): if type(obj) == str: building = ROOT.SELECT('building') storey = building.SELECT('storey') obj = storey.SELECT(obj) else: continue floorNumber = SELECT(obj).COUNT() return floorNumber
def getObjectHeight(obj, type): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue objHeight= = obj.SELECT(height, type).UNIT('m').NUMBER() return objHeight
def getBuildingHeight(buildingName = None): if buildingName != None: building = ROOT.SELECT(buildingName) else: building = ROOT.SELECT('building') buildingHeight = building.SELECT(height).UNIT('m').NUMBER() return buildingHeight
def getSpaceHeight(spc, type): if type(spc) == str: building = ROOT.SELECT('building') space = building.SELECT('space') spc = space.SELECT(spc) else: continue spaceHeight = spc.SELECT(height, type).UNIT('m').NUMBER() return spaceHeight
def getStairhallHeight(spc): spaces = root.SELECT('space') if spc == None: stairhallHeight = 0 for space in spaces: if space.select('stair').count == 0: pass else: spaceHeight = space.SELECT('height').UNIT('m').NUMBER() stairhallHeight += spaceHeight elif type(spc) == str: stairhall = spaces.SELECT(spc) else: stairhall = spc stairhallHeight = stairhall.SELECT('height').UNIT('m').NUMBER() return stairhallHeight
def getElementHeight(elm): if type(elm) == str: elm = ROOT.SELECT(elm) else: continue space = ROOT.SELECT('space') if elm not in space: elmHeight = elm.SELECT('height').UNIT('m').NUMBER() return elmHeight
def getStairHeight(elm): if type(elm) == str: building = ROOT.SELECT('building') storey = building.SELECT('storey') stair = storey.SELECT('stair') elm = stair.SELECT(elm) else: continue stairHeight = elm.SELECT('height').UNIT('m').NUMBER() return stairHeight
def getStairStepHeight(elm): if type(elm) == str: building = ROOT.SELECT('building') storey = building.SELECT('storey') stair = storey.SELECT('stair') elm = stair.SELECT(elm) else: continue stairStepHeight = elm.SELECT('riser height').UNIT('mm').NUMBER() return stairStepHeight
def getBuildingElevationHeight(): building = ROOT.SELECT('building') stories = building.SELECT('storey') buildingElevationHeight = 0 for storey in stories: if storey.SELECT('height')>0: buildingElevationHeight += storey.SELECT('height').UNIT('m').NUMBER() else: pass return buildingElevationHeight
def getFloorElevationHeigh(obj): building = ROOT.SELECT('building') stories = building.SELECT('storey') if type(obj) == str: obj = stories.SELECT(obj) else: continue storeyNumber = SELECT(obj).COUNT() floorElevationHeight = 0 for storey in stories: currentStoreyNumber = SELECT(storey).COUNT() if currentStoreyNumber
def getObjectLength(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue objLength=obj.SELECT('length').UNIT('m').NUMBER() return objLength
def getStairStepLength(elm): if type(elm) == str: building = ROOT.SELECT('building') storey = building.SELECT('storey') stair = storey.SELECT('stair') elm = stair.SELECT(elm) else: continue stairStepLength = elm.SELECT('clear length').UNIT('mm').NUMBER() return stairStepLength
def getObjectWidth(obj, type): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue objWidth = obj.SELECT('width', type).UNIT('m').NUMBER() return objWidth
def getSpaceWidth(spc): if type(spc) == str: building = ROOT.SELECT('building') space = building.SELECT('space') spc = space.SELECT(spc) else: continue spcWidth = spc.SELECT('width', type).UNIT('m').NUMBER() return spcWidth
def getElementWidth(elm, type): space = ROOT.SELECT('space') if type(elm) == str: elm = ROOT.SELECT(elm) else: continue if elm not in space: elmWidth = elm.SELECT('width', type).UNIT('m').number() return elmWidth
def getStairStepWidth(elm): if type(elm) == str: building = ROOT.SELECT('building') storey = building.SELECT('storey') stair = storey.SELECT('stair') elm = stair.SELECT(elm) else: continue stairStepWidth = elm.SELECT('clear width', type).UNIT('mm').NUMBER() return stairStepWidth
def getObjectThickness(obj, type): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue objectThickness = obj.SELECT('thickness', type).UNIT('m').NUMBER() return objectThickness
def getWallThickness(obj, type): if type(obj) == str: building = ROOT.SELECT('building') storey = building.SELECT('storey') wall = storey.SELECT('wall') obj = wall.SELECT(obj) else: continue wallThickness = obj.SELECT(thickness, type).UNIT('m').NUMBER() return wallThickness
def getObjectArea(obj, type): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue objArea = obj.SELECT('area', type).UNIT('m2').NUMBER() return objArea
def getFloorArea(spc, type): if type(spc) == str: building = ROOT.SELECT('building') space = building.SELECT('space') spc = space.SELECT(spc) else: continue floorArea = spc.SELECT('area', type).UNIT('m2').NUMBER() return floorArea
def getGrossFloorArea(): building = ROOT.SELECT('building') grossFloorArea = building.SELECT('prop', '연면적').UNIT('m2').NUMBER() return grossFloorArea
def getFloorAreaRatio(): building = ROOT.SELECT('building') floorAreaRatio = building.SELECT('prop', '용적률').UNIT('%').NUMBER() return floorAreaRatio
def getBuildingToLandRatio(): building = ROOT.SELECT('building') buildingToLandRatio = building.SELECT('prop', '건폐율').UNIT('%').NUMBER() return buildingToLandRatio
def getBuildingArea(): building = ROOT.SELECT('building') buildingArea = building.SELECT('area').UNIT('m2').NUMBER() return buildingArea
def getSiteArea(): site = ROOT.SELECT('site') siteArea = site.SELECT('area').UNIT('m2').NUMBER() return siteArea
def getElementArea(elm, type): if type(elm) == str: elm = ROOT.SELECT(elm) else: continue building = ROOT.SELECT('building') space = building.SELECT('space') if elm not in space: elmArea = elm.SELECT('area', type).UNIT('m2').NUMBER() return elmArea
def getObjectTotalArea(obj): if type(obj) != str : ObjectTotalArea =obj.SELECT(obj).UNIT('m2').NUMBER() return ObjectTotalArea else: myObject = ROOT.SELECT(obj) return ObjectTotalArea
def getTotalFloorArea(spc, type): if type(spc) == str: building = ROOT.SELECT('building') stories = building.SELECT('storey') spc = stories.SELECT(spc) else: continue totalArea = 0 for storey in stories: storeyArea = storey.SELECT('area', type).UNIT('m2').NUMBER() totalArea += storeyArea return totalArea
def getObjectSectionalArea(obj, type): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue objSectionalArea = obj.SELECT('sectional area', type).unit('mm2').number() return objSectionalArea
def getObjectGradient(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue for change in obj.SELECT('level change': objGradient = change.SELECT('gradient').NUMBER() return objGradient
def getObjectDiameter(obj, type): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue objDiameter = obj.SELECT('diameter', type).UNIT('mm').NUMBER() return objDiameter
def getObjectMaterialType(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue objMaterialType = obj.SELECT('material type') return objMaterialType
def getSpaceIlluminance(spc): if type(spc) == str: building = ROOT.SELECT('building') space = building.SELECT('space') spc = space.SELECT(spc) else: continue spcIlluminance = spc.SELECT('illuminance').UNIT('lx').num() return spcIlluminance
def isFireResistantStructure(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue if obj.SELECT('prop', '내화구조').BOOL() == True: return True
def isFireProofStructure(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue if obj.SELECT('prop', '방화구조').BOOL() == True: return True
def isFirePartition(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue if obj.SELECT('prop', '방화구획').BOOL() == True: return True
def isLoadBearing(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue if obj.SELECT('prop', '하중 지지 객체').BOOL() == True: return True
def getObjectStructure(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue objStructureType = obj.SELECT('structure type') return objStructureType
def getObjectFoundation(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue objFoundation= obj.SELECT('foundation') return objFoundation
def hasObject(obj1,obj2): if type(obj1) == str: obj1 = ROOT.SELECT(obj1) if type(obj2) == str: obj2 = ROOT.SELECT(obj2) else: continue else: if type(obj2) == str: obj2 = ROOT.SELECT(obj2) else: continue if obj1.SELECT(obj2).bool() == True: return True else: return False
def hasSpace(obj1, obj2): spaces = ROOT.SELECT('space') if type(obj1) == str: obj1 = ROOT.SELECT(obj1) if type(obj2) == str: obj2 = ROOT.SELECT(obj2) else: continue else: if type(obj2) == str: obj2 = ROOT.SELECT(obj2) else: continue if obj1.SELECT(obj2).bool() == True: return True else: return False
def hasElement(obj1,obj2): spaces = ROOT.SELECT('space') if type(obj1) == str: obj1 = ROOT.SELECT(obj1) if type(obj2) == str: obj2 = ROOT.SELECT(obj2) else: continue else: if type(obj2) == str: obj2 = ROOT.SELECT(obj2) else: continue if obj1 and obj2 not in spaces: if obj1.SELECT(obj2).bool() == True: return True else: return False
def getObjectDistance(obj1, obj2, type): if type(obj1) == str: start = ROOT.SELECT(obj1) if type(obj2) == str: end = ROOT.SELECT(obj2) else: continue else: if type(obj2) == str: end = ROOT.SELECT(obj2) else: continue distance = start.SELECT('distance', end) objDistance = distance.SELECT(type).UNIT('m').number() return objDistance
def getSpaceDistance(spc1, spc2, type): spaces = ROOT.SELECT('space') if type(spc1) == str: start = spaces.SELECT(spc1) if type(spc2) == str: end = spaces.SELECT(spc2) else: continue else: if type(spc2) == str: end = spaces.SELECT(spc2) else: continue distance = start.SELECT('distance', end) spcDistance = distance.SELECT(type).UNIT('m').number() return spcDistance
def getElementDistance(elm1, elm2, type): spaces = ROOT.SELECT('space') if type(elm1) == str: start = ROOT.SELECT(elm1) if type(elm2) == str: end = ROOT.SELECT(elm2) else: continue else: if type(elm2) == str: end = ROOT.SELECT(elm2) else: continue if (start and end) not in spaces: distance = start.SELECT('distance', end) elmDistance = distance.SELECT(type).UNIT('m').number() return elmDistance
def getObjectVerticalDistance(obj1, obj2, type): if type(obj1) == str: start = ROOT.SELECT(obj1) if type(obj2) == str: end = ROOT.SELECT(obj2) else: continue else: if type(obj2) == str: end = ROOT.SELECT(obj2) else: continue verticalDistance = start.SELECT('vertical distance', end) objVerticalDistance = verticalDistance.SELECT(type).UNIT('m'). number() return objVerticalDistance
def isConnectedTo(obj1, obj2): if type(obj1) == str: start = ROOT.SELECT(obj1) if type(obj2) == str: end = ROOT.SELECT(obj2) else: continue else: if type(obj2) == str: end = ROOT.SELECT(obj2) else: continue distance = start.SELECT('distance', end).UNIT('m').number() if distance == 0: return True else: return False
def isConntectedToExternal(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue if obj.SELECT('is external').BOOL() == True: return True else: return False
def isSurrounded(obj1, obj2): if type(obj1) == str: obj1 = ROOT.SELECT(obj1) if type(obj2) == str: obj2 = ROOT.SELECT(obj2) else: continue else: if type(obj2) == str: obj = ROOT.SELECT(obj2) else: continue if obj1.SELECT('surrounded', obj2).BOOL() == True: return True else: return False
def isAccessible(obj1, obj2): spaces = ROOT.SELECT('space') if type(obj1) == str: obj1 = spaces.SELECT(obj1) if type(obj2) == str: obj2 = spaces.SELECT(obj2) else: continue else: if type(obj2) == str: obj = spaces.SELECT(obj2) else: continue distance = start.SELECT('distance', end) if distance.SELECT('accessible').BOOL() == True: return True else: return False
def isExternal(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue if obj.SELECT('is external').BOOL() == True: return True else: return False
def isEgressDirection(obj): space = ROOT.SELECT('space') if type(obj) == str: obj = ROOT.SELECT(obj) else: continue space = ROOT.SELECT('space') escapeRoute = space.SELECT('escape route') escapeRouteDirection = escapeRoute.SELECT('direction') if obj is in space.SELECT('door'): doorDirection = obj.SELECT('direction') if escapeRouteDirection == doorDirection: return True else : return False else: obj.ERROR('문이 아님')
def isVacant(obj, numeric): if type(obj) == str: obj = ROOT.SELECT(obj) else: continue if obj.SELECT('is vacant', numeric).BOOL() == True: return True
def isParallel(obj1, obj2): if type(obj1) == str: obj1 = ROOT.SELECT(obj1) if type(obj2) == str: obj2 = ROOT.SELECT(obj2) else: continue else: if type(obj2) == str: obj2 = ROOT.SELECT(obj2) else: continue if obj1.SELECT('is parallel', obj2).BOOL() == True: return True else: return False
def isInstalled(obj1, obj2, type): spaces = ROOT.SELECT('space') if type(obj1) == str: obj1 = spaces.SELECT(obj1) if type(obj2) == str: obj2 = ROOT.SELECT(obj2) else: continue else: if type(obj2) == str: obj2 = ROOT.SELECT(obj2) else: continue if obj1.SELECT(obj2).bool() == True: isInstalled = obj1.SELECT('is installed', obj2) installedType = isInstalled.SELECT(type).bool() if installedType == True: return True else: return False else : obj1.ERROR('설치되지 않음')
def getObject(obj): if type(obj) == str: obj = ROOT.SELECT(obj) else : continue return obj
def getSpace(spc): if type(spc) == str: building = ROOT.SELECT('building') space = building.SELECT('space') spc = space.SELECT(spc) else: continue return spc