Ejemplo n.º 1
0
def getBuildingID(inputDrawing):
    bldgID = ""
    try:
        bldgID = gseDrawing.getBuildingIDFromPath(inputDrawing) 
    except:
        bldgID = ""
    return bldgID
Ejemplo n.º 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