AnsweredAssumed Answered

clip nothing

Question asked by lks12081 on Jan 24, 2016
Latest reply on Jan 25, 2016 by xander_bakker
import arcgisscripting, sys, string, os
gp = arcgisscripting.create(9.3)
gp.OverWriteOutput = 1

FCsToClip = sys.argv[1]
FCClip = sys.argv[2]
outDir = sys.argv[3]

uniq = 9000
cur = gp.SearchCursor(FCClip)
row = cur.Next()
while row:
    DDAbb=row.getValue("ABBREVIATION")
    feat = row.shape
    DDAbb_=DDAbb.replace (" ", "_")
    if not gp.Exists(outDir+"\\"+DDAbb_):
        gp.Clip_analysis(FCsToClip, feat, outDir+"\\"+DDAbb.replace (" ", "_"))
        gp.addMessage(DDAbb.replace (" ", "_"))
    else:
        gp.Clip_analysis(FCsToClip, feat, outDir+"\\"+DDAbb.replace (" ", "_")+"_"+str(uniq))
        uniq+=1
        gp.addMessage(DDAbb.replace (" ", "_")+"_"+str(uniq))
    row = cur.Next()  
del cur, row

 

Message was edited by: Dan Patterson I provided python syntax highlighting to make it easier to read

Outcomes