|
POST
|
If you want a python solution using arcpy, this example shows converting the FeatureClass to a NumPy array, get the unique values of the desired field then running an da.UpdateCursor with an expression to set the associated integer value field. You'd probably be able to just do this much faster manually as Rebecca suggested, but this could be part of a python implementation I guess. I tested this on sample data and it populates the "uvalID" short integer field (that I added to the feature class) with a value incrementing from 1 using the unique values in the field "MCITY". def AddIDToUniqueValues():
datarr = []
fc = r'H:\Documents\ArcGIS\Default.gdb\L_Join_Output'
numparr = arcpy.da.FeatureClassToNumPyArray(fc, ['OBJECTID','MCITY'])
uniquevals = np.unique(numparr['MCITY'])
assocval = 1
updatefield = 'uvalID'
for uval in uniquevals:
print uval
expr = "MCITY= '"+ uval + "'"
with arcpy.da.UpdateCursor(fc, updatefield, expr) as ucur:
print expr
for row in ucur:
print assocval
row[0] = assocval
ucur.updateRow(row)
assocval = assocval + 1
... View more
12-28-2015
08:52 AM
|
1
|
0
|
4115
|
|
POST
|
I don't believe SelectLayerByAttribute_management supports GROUP BY.
... View more
12-15-2015
05:30 AM
|
0
|
0
|
7754
|
|
POST
|
Can someone help me work out why this error message is persisting Probably because you are using Personal Geodatabase and things are executing in 64-bit processes (just a guess). I'd recommend you move everything into a File Geodatabase and then run your script and see if it works. Other than that, you'll likely need to explicitly set your script to run 32-bit because, well... that's MS Access (.mdb).
... View more
12-07-2015
11:56 AM
|
0
|
0
|
1958
|
|
POST
|
My guess is that it's just a field formatting issue causing you to see different values in the destination table you are inserting into. That is, after your process completes go ahead and open the Access database and access the properties of that destination table. In Design View of the table, look at the properties of the YES/NO field you inserted into. You should see "General" and "Lookup" tabs at the bottom of the window. The Lookup tab should reveal a "Display Control" property and if you set this to "Check box" and save the table, when you open it in Datasheet view it will display the Checkbox control as seen in the original table/field you copied from.
... View more
12-07-2015
11:44 AM
|
0
|
1
|
4966
|
|
POST
|
Open "DeterminandsForSimcat" table in the Access database and view the table in Design View. Is that field (I don't think you mention the field name anywhere) set as Yes/No data type? You really should be explicitly stating any fields, it's just really bad in any case to just issue sql with * --- don't be lazy, write out the fields.
... View more
12-07-2015
11:24 AM
|
0
|
0
|
4966
|
|
POST
|
Thank you for your input! This actually started a larger conversation within our organization and we'll be looking to come up with a valid approach to efficient shared development. I'm not sure if things like centralized code repositories, versioning, deployment processes for dev, test and prod were fully thought about for WAB development (perhaps I'm mistaken but I haven't found much info). I marked your reply as the correct answer as it seems to be the solution! But we still need to answer the larger issue of sharing and deploying multiple WAB implementations between developers. Thanks again!
... View more
10-30-2015
12:39 PM
|
2
|
0
|
2052
|
|
POST
|
I really do not have an understanding of what you are trying to do with your script. I'd suggest you strip out as much as possible, simplifying things down to bare necessities that accomplishes a portion or a simplified version of what you expect. Then build upon what you learn from that.
... View more
10-30-2015
05:18 AM
|
0
|
0
|
545
|
|
POST
|
From your example code it looks like you are just passing in the path to the table, so... maybe the parameter should just be a string type?
... View more
10-29-2015
08:12 AM
|
0
|
1
|
4113
|
|
POST
|
You must add the parameters to the Toolbox script. Right-click the Toolbox script and open the Properties dialog to find the Parameters tab.
... View more
10-29-2015
07:25 AM
|
0
|
9
|
4113
|
|
POST
|
Can you specify the file (.js, .json or other) and the approximate line/position that you would be modifying or updating? We have some JavaScript resources and can work on this in-house as well. Thanks again!
... View more
10-29-2015
05:23 AM
|
0
|
1
|
3211
|
|
POST
|
Darren Wiens posted 2 links that shows you what you will likely need in order to accomplish what you want. I assume you need to open a specific Geoprocessing toolbox that you have created in order to collect parameters from the user, then perform the task and do this from the click of a button in your add-in:
class ButtonClass_OpenToolBoxName(object):
"""Implementation for EOCTools_addin.button_1 (Button)"""
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
pythonaddins.GPToolDialog(r'C:\FolderName\ToolboxName.tbx', 'ToolboxScriptName')
... View more
10-28-2015
12:04 PM
|
1
|
1
|
2109
|
|
POST
|
In a Google Chrome browser, clicking the "Options-->Export To CSV" on an Attribute Table successfully adds the .csv file to the downloads folder on the computer and appears at the bottom of the browser: In an Internet Explorer 11 browser, clicking the "Options-->Export To CSV" on an Attribute Table does nothing. What appears to be a notepad window does popup for a split second and then shuts down (it's too fast to tell exactly what it is), but nothing is downloaded and no errors seem to get thrown.
... View more
10-28-2015
05:19 AM
|
0
|
4
|
3211
|
|
POST
|
Are there any updated versions of the Attribute Table widget that has a fix for the exporting to csv issue with Internet Explorer 11? This does not seem to be an issue with Google Chrome but the task fails in IE 11 and most of our user base will be running IE 11.
... View more
10-27-2015
10:42 AM
|
0
|
6
|
6023
|
|
POST
|
Kevin -- your OP that I marked as the correct answer does work for me. I missed/skipped over the widget asking for the input Feature Set parameter. Once I re-published the model with that Feature Set as parameter, it shows up in the Geoprocessing widget workflow. I was simply expecting it to just work without additional user input.
... View more
10-26-2015
01:06 PM
|
0
|
0
|
1572
|
| 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
|