I am trying to write a script partially in ArcGIS ModelBuilder and adding an if statement on my own.
It uses the Feature Compare tool in arcgis and I want to use the result.getOutput in an If statement so that if it is true then run a process - in this case a copy features.
The big picture here is to compare two features and if there are differences in them then truncate and update.
I need help with the If statement or alternative. I don't think I'm getting result.getOutput value to pass to the if statement and then run the if. Can anyone see where this might be incorrect?
# -*- coding: utf-8 -*-# -------------------------------------------------------------------------- -# compare_test1.py# Created on: 2015-11-03 14:06:44.00000# (generated by ArcGIS/ModelBuilder)# Description: # ---------------------------------------------------------------------------# Import arcpy moduleimport arcpy# Local variables:TONGIS_PARKING = "Database Connections\\ESRI10PUB GIS_VIEWER WAREHOUSE.sde\\TONGIS.PARKING"TONGIS_PARKING__2_ = "Database Connections\\ESRI10PUB GIS_VIEWER WAREHOUSE.sde\\TONGIS.PARKING"test = ""PARKING_CopyFeatures = "G:\\Projects 10\\Corporate Services\\Information Technology\\Default.gdb\\PARKING_CopyFeatures"# Process: Feature Compareresult = arcpy.FeatureCompare_management(TONGIS_PARKING, TONGIS_PARKING__2_, "GLOBALID", "ALL", "", "0.00001 Unknown", "0", "0", "", "", "NO_CONTINUE_COMPARE", test)changes = result.getOutput(1)#print "Comparision Result is: " + changeschange = str(changes)if changes == "True": # Process: Copy Features arcpy.CopyFeatures_management(TONGIS_PARKING__2_, PARKING_CopyFeatures, "", "0", "0", "0")
أكثر...
It uses the Feature Compare tool in arcgis and I want to use the result.getOutput in an If statement so that if it is true then run a process - in this case a copy features.
The big picture here is to compare two features and if there are differences in them then truncate and update.
I need help with the If statement or alternative. I don't think I'm getting result.getOutput value to pass to the if statement and then run the if. Can anyone see where this might be incorrect?
# -*- coding: utf-8 -*-# -------------------------------------------------------------------------- -# compare_test1.py# Created on: 2015-11-03 14:06:44.00000# (generated by ArcGIS/ModelBuilder)# Description: # ---------------------------------------------------------------------------# Import arcpy moduleimport arcpy# Local variables:TONGIS_PARKING = "Database Connections\\ESRI10PUB GIS_VIEWER WAREHOUSE.sde\\TONGIS.PARKING"TONGIS_PARKING__2_ = "Database Connections\\ESRI10PUB GIS_VIEWER WAREHOUSE.sde\\TONGIS.PARKING"test = ""PARKING_CopyFeatures = "G:\\Projects 10\\Corporate Services\\Information Technology\\Default.gdb\\PARKING_CopyFeatures"# Process: Feature Compareresult = arcpy.FeatureCompare_management(TONGIS_PARKING, TONGIS_PARKING__2_, "GLOBALID", "ALL", "", "0.00001 Unknown", "0", "0", "", "", "NO_CONTINUE_COMPARE", test)changes = result.getOutput(1)#print "Comparision Result is: " + changeschange = str(changes)if changes == "True": # Process: Copy Features arcpy.CopyFeatures_management(TONGIS_PARKING__2_, PARKING_CopyFeatures, "", "0", "0", "0")
أكثر...