def getFloorID(inputDrawing): floorID = "" try: floorID = gseDrawing.getFloorIDFromPath(inputDrawing) except: floorID = "" return floorID
def buildViewWhereClause(viewIdField,inputDrawing): # build a where clause based on the idfield dwg = inputDrawing[inputDrawing.rfind(os.sep)+1:] if inputDrawing == '*': whereClause = '' elif viewIdField.upper() == "SOURCEDWG": drawingID = gseDrawing.getDrawingFromName(dwg) whereClause = viewIdField + " = '" + drawingID + "'" elif viewIdField.upper() == "FLOORID": floorID = gseDrawing.getFloorIDFromPath(inputDrawing) whereClause = viewIdField + " = '" + floorID + "'" elif viewIdField.upper() == "BUILDINGID": buildingID = gseDrawing.getBuildingIDFromPath(inputDrawing) whereClause = viewIdField + " = '" + buildingID + "'" else: raise Exception("Could not build a view where clause for " + viewIdField) arcpy.AddMessage( whereClause) return whereClause