Пример #1
0
def getFloorID(inputDrawing):
    floorID = ""
    try:
        floorID = gseDrawing.getFloorIDFromPath(inputDrawing) 
    except:
        floorID = ""
    return floorID
Пример #2
0
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