I'm trying to geocode a few address using a custom model created. When running the model via model builder all runs perfectly.
Also when running it via the embedded interactive python console in ArcCatalog using the following code it also runs smooth.
>>> arcpy.ImportToolbox("C:\\Users\\jvidin\\AppData\\Roaming\\ESRI\\Desktop10.1\\ArcToolbox\\My Toolboxes\\usps_geocoder.tbx","geocoder")
<module 'geocoder' (built-in)>
>>> arcpy.geocoder_geocoder('01')
<Result ''>
>>>
The problem occurs when trying to run it via IDE using the following code:
The model has one and only one exposed parameter and it is an inline parameter %<param>% used for outputs paths creation .
>it creates the output .gdb based on argument sbr and sets env.workspace to it. (works)
>than when it runs arcpy.geocoder2_geocoder(sbr), in egg. sbr = '01' it fails with:
**Process finished with exit code -1073741819 (0xC0000005)** not of much help.
Script below.
def geocoder(sbr):
try:
fgdb = str(sbr) + '.gdb'
path = "J:/Postal/Postal/99_Geocode/_results/"
env.workspace = path+fgdb
print env.workspace
arcpy.CreateFileGDB_management(path, fgdb)
arcpy.geocoder_geocoder(sbr)
except Exception as e:
print e.message
Really have not clue why it continues to fail, tried many things out of ideias. All the outputs of geocode_geocode() model are setted to same env.workspace created.
The geocode_geocode() model -> contains 2 composite locators that run one after other.
Thanks for support.