Hi,I'm attempting to check for the existence of a shapefile if it does not exist, an alternate dummy shapefile is returned in its place. I'm using ArcGIS 10.1 Modelbuilder and specifically the Calculate Value tool, here is the code:Expression:
chkSouceSHP(%YIP Delivery from York (Shapefile Folder):%\%YIPData_Name%.shp)
Code Block:
def chkSouceSHP(SourceSHP):
if os.path.isfile(SourceSHP):
return SourceSHP
else:
return "M:\GIS\Data\YIP\Process\BlankMetadata.shp"
Data Type:
Shapefile
This code errors out with:
ERROR 000539: SyntaxError: invalid syntax (<expression>, line 1)
Item not found in this collection.
Failed to execute (Calculate Value).
Any help or hints for where I can find help would be greatly appreciated.I've read: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//0017000000v8000000This error appears to be coming from Python, and since I'm quite new to it I'm hoping someone on here who has more experience will be able to figure this out.thanks,GregOntario, Canada