Hi, I have a problem with running a Python-Add-In twice in one ArcMap-Project. During the first use of the Add-In a join between a Shape-File and another DBase-File is created. Using the Add-In a second time the join does not gets actualized.
in __init__ or onClick set arcpy.env.overwriteOutput = True
And in future, please post your code as a formatted code block, not as a screenshot. https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet
Dear Dan, dear Luke,
thank you very much for your help.
Now my Add-In works as it should.
Using "arcpy.Delete_Management" on the layer worked and setting "arcpy.env.overwriteOutput = True" gave the same positive result.
Thanks so much from Göttingen in Germany.
Christian Vorstadt
This is the error message (German):
Dataset allready exist
Failed to execute "MakeFeatureLayer"
But if I remove the layer on this way:
and start the join twice the python-window shows the same error message.
When running your add in, have the ArcMap python window open (Geoprocessing - Python menu) so you can see any error messages.
What I want to do is to actualize the Shape-File when the content of the joined dbf-file has changed.
Christian, no problem... the scripting example can be found in the Remove Join tool documentation. The only reason I was questioning this, is perhaps the tool won't allow for another join if the file already has a join on it. I am not sure whether you want the join to be removed once it is completed or whether you want to join the file and then produce a new one with the joined data, in which case you could use a copy features tool/script example to keep the resultant files together into a new file.
No, I tried but I did not manage.
Can you help me how to remove the join in the Add-In?
Excuse my english, I do not have much practice.
Do you remove the join between runs of the addin?
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.