|
POST
|
Iterate through each version to see if it will fail on a specific one. You can add the following code to do this: for version in verList:
print version
arcpy.ReconcileVersions_management(workspace,"ALL_VERSIONS","SDE.Default",version,"NO_LOCK_ACQUIRED","NO_ABORT","BY_ATTRIBUTE","FAVOR_TARGET_VERSION","NO_POST","KEEP_VERSION")
... View more
01-03-2014
06:51 AM
|
0
|
0
|
1023
|
|
POST
|
Hi Meredith, You can run the Summary Statistics tool and then Append the results to the original table.
... View more
01-03-2014
05:57 AM
|
1
|
0
|
1173
|
|
POST
|
Does it report what line it is failing at? If not, can you use PyScripter to debug the code and find out?
... View more
01-03-2014
05:31 AM
|
0
|
0
|
3257
|
|
POST
|
If you ran the script once and it failed, and then commented out the code and re-ran the script, the 'dataList' variable was probably still defined since you did not close the script. 'dataList' will need to be defined in order to analyze the datasets and feature classes since you are calling this variable: arcpy.AnalyzeDatasets_management(workspace, "SYSTEM", dataList, "ANALYZE_BASE", "ANALYZE_DELTA", "ANALYZE_ARCHIVE") Uncomment the lines defining this variable and re-run the script and see if you receive a new error message.
... View more
01-03-2014
05:16 AM
|
0
|
0
|
3257
|
|
POST
|
Hi Jamie, I would recommend creating a mosaic dataset of the raster datasets. You can then calculate statistics on the mosaic dataset. This will calculate statistics as if all of the rasters were one seamless image and you should no longer have this problem.
... View more
01-02-2014
09:34 AM
|
0
|
0
|
917
|
|
POST
|
Hi James, I've noticed after a mosaic dataset is created and statistics are calculated using a script, they will not show until you restart ArcMap. You may want to follow up with Tech Support on this. Also, you can simplify your script: def calcStatsMOSAIC(t):
arcpy.env.workspace = ws_output
mosaic_name = "ConcMosaic" + str(t)
arcpy.CalculateStatistics_management(mosaic_name, 1, 1) Try the following: 1. Create your mosaic dataset 2. Run the script 3. Restart ArcMap 4. Add the mosaic dataset to ArcMap and see if you 'Classified' for a symbology type
... View more
01-02-2014
06:33 AM
|
0
|
0
|
1393
|
|
POST
|
Hi all, i'm using the TemplatePicker widget in the editor and want to have only one item and not the 4 i have in the layer . has any one have an idea . i have tried the "ITEMS" instead of the layer with no luck. i also tried to use jquery selector to hide the other - no luck there either. $('#ThePicker td[idx!="2"]').css("display", "none"); if anyone has suggestion ,i'll be happy to hear. thanks iris Hi Iris, You can query out the layer by ID. Ex: var layersWildfire = [results.layers[1].layer] function initEditor(results) {
var layerInfosWildfire = array.map(results.layers, function(result) {
return {
featureLayer : result.layer
};
});
var layersWildfire = [results.layers[1].layer]
var tpCustom = new TemplatePicker({
featureLayers: layersWildfire,
columns: 2
}, "divLeft")
tpCustom.startup();
var editorSettings = {
map: map,
geometryService: new GeometryService("http://server/arcgis/rest/services/Utilities/Geometry/GeometryServer"),
layerInfos: layerInfosWildfire,
templatePicker: tpCustom,
}
var editorParams = {
settings: editorSettings
}
widgetEditor = new Editor(editorParams, "divTop")
widgetEditor.startup();
};
... View more
01-02-2014
05:29 AM
|
0
|
0
|
2200
|
|
POST
|
One way to could accomplish this is by creating a python add-in tool. The only thing is that you will need to specify the layer and table that participate within the relationship. Here is an example of an add-in that draws a rectangle, selects the features from a layer in the MXD called 'Airports' and then selects records from the related table ('Districts'). import arcpy import pythonaddins class ToolClass2(object): """Implementation for UserData2_addin.tool (Tool)""" def __init__(self): self.cursor = 0 self.enabled = True self.shape = "Rectangle" def onRectangle(self, rectangle_geometry): #Create Polygon from drawn extent extent = rectangle_geometry XMAX = extent.XMax XMIN = extent.XMin YMAX = extent.YMax YMIN = extent.YMin pnt1 = arcpy.Point(XMIN, YMIN) pnt2 = arcpy.Point(XMIN, YMAX) pnt3 = arcpy.Point(XMAX, YMAX) pnt4 = arcpy.Point(XMAX, YMIN) array = arcpy.Array() array.add(pnt1) array.add(pnt2) array.add(pnt3) array.add(pnt4) array.add(pnt1) polygon = arcpy.Polygon(array) #Select features that intersect drawn Polygon mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] for layer in arcpy.mapping.ListLayers(mxd, "Airports", df): arcpy.SelectLayerByLocation_management(layer, "INTERSECT", polygon, "#", "NEW_SELECTION") items = [] #Append primary key values to list with arcpy.da.SearchCursor(layer, ["District"]) as cursor: for row in cursor: items.append(row[0]) #Remove duplicates from list items = dict.fromkeys(items) items = items.keys() for table in arcpy.mapping.ListTableViews(mxd, "Districts", df): #Clear selection if one exists try: arcpy.SelectLayerByAttribute_management(table, "CLEAR_SELECTION") except: pass for item in items: #Select records in foreign key arcpy.SelectLayerByAttribute_management(table, "ADD_TO_SELECTION", "District = '" + item + "'")
... View more
01-02-2014
03:30 AM
|
0
|
0
|
1365
|
|
POST
|
Hi Noah, After you select a feature, open the attribute table and at the top click on the tool 'Related Tables' (2nd tool from the left). This will list your related tables. Select the table and it will show the related records.
... View more
12-31-2013
09:57 AM
|
0
|
0
|
1365
|
|
POST
|
Hi Val, Try performing the join manually using the Add Join tool. If the tool completes, open your Results window (Geoprocessing menu > Results) and then right-click on the result > Copy As Python Snippet. You can then paste this into a text editor and compare this to your current script.
... View more
12-31-2013
09:32 AM
|
0
|
0
|
1342
|
|
POST
|
Hi Tony, I could not reproduce this with a shapefile. However, for a File Geodatabase feature class, the Precision and Scale are ignored. See the following link. When you create a float, double, or integer field and specify 0 for precision and scale, the tool will attempt to create a binary type field if the underlying database supports it. Personal and file geodatabases support only binary type fields, and precision and scale are ignored.
... View more
12-31-2013
09:12 AM
|
0
|
0
|
1493
|
|
POST
|
Hi Tony, At first you state that you are using a feature class, then a shapefile, and then at some point you are performing an export. Can you explain your workflow a little more? Also, what version of the software are you using, including service packs? i.e. 10.1 SP1 Thanks!
... View more
12-31-2013
07:40 AM
|
0
|
0
|
1493
|
|
POST
|
Hi Philip, You can do this running the Feature Class to Feature Class tool. Before executing the tool, click on 'Environments' at the bottom > expand Z values > set 'Output has Z Values' to Disabled: [ATTACH=CONFIG]30146[/ATTACH]
... View more
12-30-2013
06:40 AM
|
0
|
0
|
2178
|
|
POST
|
Hi James, Check in Task Manager to make sure there are no ArcMap.exe running. I've seen in some cases where ArcMap will close, but the executable will still be running. If this is the case, manually kill the executable in Task Manager and then run through steps 3 - 5.
... View more
12-30-2013
06:30 AM
|
0
|
0
|
913
|
|
POST
|
Amazing! I got it to work. What a happy camper I am right now! One little tweak would be nice though.... At this point, when the user selects a year, it works perfectly. BUT - the other years that were available before all disappear. For instance, a particular station has the following years of data: 2009, 2010, 2011. When you select 2009, the other years (2010 and 2011) are no longer displayed in the combo box. Is there a way upon selection to keep these other years still displayed? Thanks guys! Katie I haven't tested Wayne's suggestion, but another option would be to call the actually feature class rather than the layer in the MXD and create a Feature Layer. Ex: import arcpy
import pythonaddins
class ComboBoxClass1(object):
"""Implementation for UserData_addin.combobox (ComboBox)"""
def __init__(self):
self.editable = True
self.enabled = True
self.dropdownWidth = 'WWWWWW'
self.width = 'WWWWWW'
def onSelChange(self, selection):
layer = r"C:\temp\python\test.gdb\Stream_Temperatures"
arcpy.MakeFeatureLayer_management(layer, "Selection")
arcpy.SelectLayerByAttribute_management("Selection", "NEW_SELECTION", "SampleYear = '" + selection + "'")
arcpy.RefreshActiveView()
def onFocus(self, focused):
layer = r"C:\temp\python\test.gdb\Stream_Temperatures"
self.items = []
values = [row[0] for row in arcpy.da.SearchCursor(layer, ["SampleYear"])]
for uniqueVal in sorted(set(values)):
self.items.append(uniqueVal) This will add a feature layer to the MXD with the selected features. All of the sample years will be still be available in the combo box without having to clear the selection first. Each selection will overwrite the feature layer within the MXD.
... View more
12-30-2013
02:24 AM
|
0
|
0
|
4029
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-08-2026 12:27 PM | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|