New answers tagged


I think arcpy.da.Editor requires an arcpy environment workspace (arcpy.env.workspace) to be set. This is what I've got in one of my Editing python scripts arcpy.env.workspace = os.path.join(outFolderPath, outName) edit = arcpy.da.Editor(arcpy.env.workspace) edit.startEditing(True, True) edit.startOperation()


Looks like you are not referencing the full path to your newly created SDE connection. Try this: edit = arcpy.da.Editor(os.path.join(outFolderPath, outName))


Is using direct connect an option? This is preferred as SDE services (Three Tier connections) are depreciated. If must use a three tier connection your SDE administrator will be able to tell you the service name, 5150 and 5151 are the most common ones I have come across (they correspond to the port number).


As mentioned in the documentation, you can refer to other 'types' by using the appropriate ID. This is what you set in the wizard when creating the combo-box, button, etc. and you can change it by editing the config.xml file in the root directory of your addin source. A really simple example that clears a combo-box list when the user presses a button: ...


Point Distance - arcpy.PointDistance_analysis (in_features, near_features, out_table, {search_radius})


You have some repeating processes that could probably be rearranged. It may help with speed. Clearing all the layers' selections could be done at the beginning of the loop instead of within each if/else statement Edit (this may slow down the process since the clear selection happens every iteration): if count == 1: with arcpy.da.SearchCursor(table, ...


Based off your code, it sounds like you're trying to disable a button rather than an entire toolbar. Instead of WTF_toolbar.enabled = False do fish_button.enabled = False to disable the button. Same goes for WTF_toolbar.enabled = True. More info here

Top 50 recent answers are included