Tag Info

New answers tagged

2

I've figured this out with help from some nudging comments by @ChrisW on this question and an old answer by @MattWilkie. Please only do the following at your own risk because I profess no system administration skills. I opened a CMD window from the Windows Start Menu as Administrator I checked the current file association for *.py files by typing: assoc ...


0

A broken record here but, having the Python window opening when adding in the toolbar to your map will often tell you where the problem is in your code. But I think your problem might be with the spaces that you have in the name of your tools and buttons. Additionally there is a discrepancy between the name of your button in your Python code and the ...


0

Once you've created the toolbar with the button tool via the python add-in wizard, you can edit the python script in the Install folder and use the pythonaddins.GPToolDialog in the buttons onClick method. Example from the help: import arcpy import pythonaddins class OpenGPTool(object): def __init__(self): self.enabled = True ...


2

I can think of two things off the top of my head. If you want to stick with an Add-In, you can use the onLinemethod and simply iterate through the line geometry the user creates and pass those points into an array and convert that to a polygon. The can add segments and finishes by double clicking. Or, another option is to make a script tool. With a ...


3

You are collecting the extents for each polygon correctly, but need to zoom to them within the loop, or a later loop depending on what you want to do. For example to zoom in the same loop as the search cursor e.g. with arcpy.da.SearchCursor(SelLayer,"SHAPE@") as SCur: for feat in SCur: # I'm going to assume polygon/polyline ...


2

Unfortunately, it is not possible to "reload" the Python add-in while having the ArcMap session open. This is because the add-in is loaded into the program cache. So, the only way to see the changes done is to close ArcMap, install a new add-in and then start ArcMap (as you approach it now). You should spend most of your time debugging and developing the ...



Top 50 recent answers are included