bionicbiplov45

Problem in path name while performing multiple clip

Discussion created by bionicbiplov45 on Apr 22, 2014
Latest reply on Apr 23, 2014 by xander_bakker
Hello everyone!

I am making a tool through script to perform multiple clip in feature classes but has encountered problem: input feature does not exist. I have tried to make the path effective but still got same problem.
My code is:

import arcpy
import os

inWorkspace = arcpy.GetParameterAsText(0)
clipFeatures = arcpy.GetParameterAsText(1)
outWorkspace = arcpy.GetParameterAsText(2)
clusterTolerance = arcpy.GetParameterAsText(3)

try:
    inwrk=os.path.join(inWorkspace)
   
    arcpy.env.workspace = inwrk
    fcs = arcpy.ListFeatureClasses()
    outwrk=os.path.join(outWorkspace)
    f=os.path.basename('%s'%outwrk)
    g=os.path.dirname(r'%s'%outwrk)
    g1=arcpy.CreateFolder_management(g,f)
    a1='%s'%g1
    b1=os.path.join(a1)
    arcpy.env.workspace = b1
   
    #os.chdir(b1)

    for fc in fcs:
        featureClassName = arcpy.ValidateTableName(fc,outwrk)
        outFeatureClass = os.path.join(outwrk, featureClassName)
        if fc != os.path.basename(clipFeatures):
            arcpy.Clip_analysis(fc,clipFeatures,outFeatureClass,clusterTolerance)
   

       
except Exception,e:
    arcpy.AddMessage(arcpy.GetMessages(2))
    print arcpy.GetMessages(2)

Please suggest some way to work out!
Thank YOU

Outcomes