|
POST
|
What are the correct paramters for adding a BLOB field to a FGDB FeatureClass? No errors popup, but the field doesn't show up after it adds it with this code. arcpy.AddField_management(outfc, "hgraph", "BLOB") Am I missing something with this? Edit: what I am missing is that the is not visible in the attribute table or identify window when loaded into ArcMap 10.1, but that field does show up in the properties-->fields list. It is simply not set to visible.
... View more
04-16-2013
07:25 AM
|
0
|
0
|
2669
|
|
POST
|
Yes, one option would be to author a model or script tool that has 2 data-time parameters and based on use input executes some logic. Then from a button in your add-in you could launch that tool. GP Tools have 100's of parameter types that allow you to build a UI for accepting user input and built-in and customize-able validation that can be run before the tool is actually executed. Another option would be to build a .Net add-in. The .Net framework offers a rich environment for building windows forms that can accept user input and execute code. If you would prefer to author your form in .Net you could still have you business logic in a python script tool and call the tool from .Net passing in any required parameters. Thanks, Chris --- yes, I have done just what you describe with launching Toolbox I created with GPToolDialog. It seems a bit disconnected, but it works. I had hoped to have a few more UI control elements available via the Python Add-In, but like you say I can implement a .NET add-in to accomplish this. This is my area of familiarity (but with creating COM components) -- should be a nice change from having to build Setup.exe/.msi and dealing with installer issues! James
... View more
04-15-2013
03:07 AM
|
0
|
0
|
1121
|
|
POST
|
updated with correction (lower case in "thePoly") and array revamped. Still doesn't select a dang thing. edit: yes, it does work 🙂 That only took about 1hr of google searching! lol. Have a great weekend. def onRectangle(self, rectangle_geometry): mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] ext = rectangle_geometry thepoly = arcpy.Polygon(arcpy.Array([ext.lowerLeft, ext.lowerRight, ext.upperRight, ext.upperLeft]),df.spatialReference) for lyr in arcpy.mapping.ListLayers(mxd): arcpy.AddMessage(lyr.name + " first layer found") if lyr.name=="mylayer": dlyr = lyr arcpy.SelectLayerByLocation_management(lyr, "INTERSECT", thepoly, "", "NEW_SELECTION") arcpy.RefreshActiveView()
... View more
04-12-2013
10:44 AM
|
0
|
0
|
1123
|
|
POST
|
Okay, where is the example to select feature by an extent? The select with a point geometry was easily found, but come'on --- the select by rectangle tool is already a default tool! I'd think there'd be an example of how this tool selects features since it's such a common tool! Any help? I have this so far which doesn't select anything: def onRectangle(self, rectangle_geometry): mxd = arcpy.mapping.MapDocument("CURRENT") ext = rectangle_geometry #Creates a polygon object a = arcpy.Array() a.add(ext.lowerLeft) a.add(ext.lowerRight) a.add(ext.upperRight) a.add(ext.upperLeft) a.add(ext.lowerLeft) thepoly = arcpy.Polygon(a) for lyr in arcpy.mapping.ListLayers(mxd): if lyr.name=="mylayer": dlyr = lyr arcpy.SelectLayerByLocation_management(dlyr, "INTERSECT", thePoly, "", "NEW_SELECTION") arcpy.RefreshActiveView()
... View more
04-12-2013
10:36 AM
|
0
|
1
|
3451
|
|
POST
|
I see that we can arm-twist things with GPToolDialog(toolbox, tool_name) maybe. http://resources.arcgis.com/en/help/main/10.1/index.html#/The_pythonaddins_module/014p00000021000000/ j
... View more
04-12-2013
06:00 AM
|
0
|
0
|
1121
|
|
POST
|
So, I am a ArcObjects/COM developer (C#/VB/.NET) struggling to accept the restrictions that are being placed on my new role as a Python Add-In developer!!! As you can probably guess at this point, my frustration resides with the limited GUI capabilities that are offered for creating new and functional tools for ArcGIS 10.1 --- don't get me wrong, I've managed to build some really functional geoprocessing tools for ArcToolbox and will continue to do that. But I am struggling to incorporate the mapping environment. Anyway --- to my question: How can I acquire two date parameters from the user via a Python Add-In? I do not see any datetime pickers available. No textbox controls that I could arm-twist into date values. There's a ComboBox control, but useless for my need. I was also under the impression that at ArcGIS 10.0 I could use VisualStudio Express to build an Add-In (not a Python Add-In), which would provide access to those GUI components I want! Is this a viable option (I know it wouldn't be Python-based)? Thanks for listening and thanks for any input! J
... View more
04-12-2013
05:33 AM
|
0
|
3
|
1750
|
|
POST
|
Resolved. All of my issues/problems were related to Citrix environment and the setup of my specific user account. With that said, my solution was to develop the Add-In on another box with all of the appropriate setup completed as outlined by Chris. I simply access the box with Remote Access. (I do have another question but will start a new thread)
... View more
04-11-2013
07:32 AM
|
0
|
0
|
2666
|
|
POST
|
I am kind of confused, I understood that you had a problem when double-clicking the esriaddin file. The makeaddin.py is just a python script that will zip up all the contents of the addin into a single compressed file with a .esriaddin extension. So yes, it is intended behavior that a new .esriaddin file is created each time. As far as running the makeaddin.py file, you could run it from any Python IDE or if it is already associated with an install of python you should be able to just double-click it. That's right. If I double-click it as in the example, it wants me to specify the program to use to open it. Also, I thought it is supposed to create a new folder with a GUID -- that is following these steps: http://resources.arcgis.com/en/help/main/10.1/index.html#/Testing_an_add_in/014p00000026000000/ Step 1. Fails. I must right-click the makeaddin.py file and choose "Edit with PythonWin". This creates the .esriaddin file. Step 2. Fails. Double-clicking the .esriaddin file wants me to specify a program to open it with. With that, it does not create the folder with the GUID: "The installation utility copies the add-in file to a generated subfolder under the default add-in folder; the subfolder is automatically generated using a globally unique identifier (GUID). This prevents file naming conflicts that might occur if several add-ins have the same file name." Step 3. only works because I choose "Add From File" to add the Add-In to my ArcMap 10.1 Again, I am working in Citrix environment and there is no ESRIRegAddIn.exe file to be found anywhere. Thanks for your input! James
... View more
04-08-2013
10:39 AM
|
0
|
0
|
2666
|
|
POST
|
With regards to double-clicking the esriaddin file and it asking you which program to open with it sounds like there is a file association problem. Go ahead and right-click any esriaddin file and select Open With > Choose Default program and select ESRIRegAddIn.exe from C:\Program Files\Common Files\ArcGIS\bin. With regards to the tool. It probably won't make a difference to the problem but go ahead and remove all the other functions in the tool you don't plan to implement, ie onMouseDown, onMouseUp, etc. The behavior that controls whether you can click and drag and what shape is drawn is controlled by the shape property of the tool class. I see you have it set to Rectangle, so that seems correct. Try adding the same logic to onMouseDown and see if that even causes a messagebox to be shown. Could you post the code with the intentional error you added? Hi Chris -- thanks for the reply. So, simply running the makeaddin.py from say PythonWin will not work? It seems to create a new .esriaddin file each time! 1. I am unsure if your suggestion will work for me as we are in a Citrix environment. There is no Program Files\Common Files\ArcGIS\bin\ESRIRegAddIn.exe available to us! Can that ESRIRegAddIn.exe tool be copied and run from our Citrix environment? I may have to use one of our server environments that has a full install of ArcGIS 10.1 on it in order to get this add-in built. Unless you have a solution for us Citirx environment people? 2. Understood about removing all of the unnecessary functions. 3. I will try to move things to the onMouseDown.
... View more
04-05-2013
11:49 AM
|
0
|
0
|
2666
|
|
POST
|
If I just open ArcMap 10.1 and add the add-in via the Add-In Manager "Add From File", it does add the toolbar. However, it does not operate as a tool (I am expecting to interact with the map, where once clicked it stays depressed and I can move the cursor over the map. Similar to the Zoom tools). update: I can't even get an error to show (I have typed in an obviously incorrect line in the def_init below and have an open python window in ArcMap. You'd think it would throw an error when I run the tool, but nothing happens). here's the .py source:
import arcpy
import pythonaddins
class GrabExtents2ToolClass(object):
"""Implementation for GrabExtents2_addin.tool (Tool)"""
def __init__(self):
self.enabled = True
self.cursor = 3
self.shape = 'Rectangle'
def onMouseDown(self, x, y, button, shift):
pass
def onMouseDownMap(self, x, y, button, shift):
pass
def onMouseUp(self, x, y, button, shift):
pass
def onMouseUpMap(self, x, y, button, shift):
pass
def onMouseMove(self, x, y, button, shift):
pass
def onMouseMoveMap(self, x, y, button, shift):
pass
def onDblClick(self):
pass
def onKeyDown(self, keycode, shift):
pass
def onKeyUp(self, keycode, shift):
pass
def deactivate(self):
pass
def onCircle(self, circle_geometry):
pass
def onLine(self, line_geometry):
pass
def onRectangle(self, rectangle_geometry):
pythonaddins.MessageBox("Add-In executed!")
... View more
04-05-2013
10:34 AM
|
0
|
0
|
2666
|
|
POST
|
I am struggling to get this working. Attempting to follow along with Creating an addin tool http://resources.arcgis.com/en/help/main/10.1/index.html#/tool/014p0000001q000000/ So, I have made it through Step 3 (and maybe my edits are not sticking or something, not sure). Keeping things very simple, I just want to display a message box when the tool is clicked. def onRectangle(self, rectangle_geometry): pythonaddins.MessageBox("Add-In executed!") However, moving on to "Testing an add-in" http://resources.arcgis.com/en/help/main/10.1/index.html#/Testing_an_add_in/014p00000026000000/ Step 2. does not work as epected. I double-click the new .esriaddin file that was created and it asks me which program to use to open it. Obviously, I don't know what to choose as it is just supposed to be some sort of ESRI dialog (per the Step 2. in the doc/link above). So, ok -- I'll just run this in PythonWin. It runs, but it does not create the expected GUID folder, nor does it copy the contents to the folder Documents\ArcGIS\AddIns\Desktop10.1. Any help? Thanks, j
... View more
04-05-2013
10:31 AM
|
0
|
6
|
3511
|
|
POST
|
Greetings, All you need to do is build a new raster catalog with the coordinate system you want. Specifically, you want to look at the "Coordinate System for Raster Column" parameter. The spatial reference of the raster column is used during data loading as: A default spatial reference for those raster datasets that have an unknown spatial reference A target spatial reference if you choose to project your raster datasets that have different spatial references from the raster column The raster catalog has been superseded by the mosaic dataset, which has many more capabilities, uses, and functions. Therefore, it is recommended that you manage raster data using a mosaic dataset instead of using a raster catalog. Mosaic datasets can be in a different coordinate system (and even datum- unlike catalogs) than the source data feeding into it. Best, Eric Cool! If the Raster Catalog has rasters of the exact same spatial extent on top of each other, you can add and populate a date field and make this time-enabled. This allows you to build time-series animations out of the rasters. I hope the Mosaic allow for this.
... View more
04-04-2013
04:05 AM
|
0
|
0
|
1558
|
|
POST
|
You may have to go through and project each of the individual raster datasets, then build a new Raster Catalog with the new rasters. Not sure and I am hoping to see an difinitive answer on this issue too, but I may just have to go through with the spatial reference conversion myself and build a new Raster Catalog.
... View more
04-03-2013
12:01 PM
|
0
|
0
|
1558
|
|
POST
|
Edit: see if the formating of your parameter is correct. I found a reference that shows it being set like so: df.time.currentTime = datetime.datetime(2008, 10, 1) What is df? If it is reference to the dataframe, then I don't think it supports Time. From what I can tell, you get the time on the Layer instead. http://resources.arcgis.com/en/help/main/10.1/index.html#/LayerTime/00s300000063000000/ Sorry if this is incorrect.
... View more
04-01-2013
04:37 AM
|
0
|
0
|
1096
|
|
POST
|
Thanks James, but would this work if the file is being served in ArcGIS Server at the same time I'm not completely certain of the answer. I suppose if you are creating and publishing a mapservice from an .mxd with the raster loaded, then I'd take a guess you would need to re-publish. I think at 10.1, the REST cache is automatically refreshed when a service/folder is updated. So... hope that I helps but I think you will likely have to just work through this one. j
... View more
03-29-2013
12:05 PM
|
0
|
0
|
1070
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-17-2020 10:47 AM | |
| 1 | 10-25-2022 11:46 AM | |
| 1 | 08-08-2022 01:40 PM | |
| 1 | 02-15-2019 08:21 AM | |
| 2 | 08-14-2023 07:14 AM |
| Online Status |
Offline
|
| Date Last Visited |
01-22-2025
02:28 PM
|