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:
Code Block:
Data Type:
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/arcgisdesk...000000v8000000
This 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,
Greg
Ontario, Canada
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:
Code:
chkSouceSHP(%YIP Delivery from York (Shapefile Folder):%\%YIPData_Name%.shp)
Code:
def chkSouceSHP(SourceSHP):
if os.path.isfile(SourceSHP):
return SourceSHP
else:
return "M:\GIS\Data\YIP\Process\BlankMetadata.shp"
Code:
Shapefile
Quote:
ERROR 000539: SyntaxError: invalid syntax (<expression>, line 1)
Item not found in this collection.
Failed to execute (Calculate Value).
I've read:
http://help.arcgis.com/en/arcgisdesk...000000v8000000
This 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,
Greg
Ontario, Canada