|
POST
|
So, a few things here.. 1. "on line 8, when you create a feature layer, it is already added to ArcMap (at the top, which you don't want)" MakeFeatureLayer_management does not necessarily add the layer to a dataframe... 2. "You have a line of code that not added the layer but the layer name, which was wrong" It's not wrong, that's a valid use for MakeFeatureLayer_management... It creates a feature layer, which is not necessarily attached to a data frame... Oh, andI believe the layer names passed to MakeFeatureLayer must be unique per-process. Otherwise, not sure how you would delete it once it's no longer needed, unless you can obtain the generate layer as an output parameter... 2."So apart from the fact that the layer appears twice in the list of feature layers, the tool seems to work and detect the selection." That's a reasonably unacceptable workaround for an obvious software problem 🙂
... View more
02-06-2018
09:04 AM
|
0
|
2
|
2610
|
|
POST
|
You need to add the layer just like I did to experience the issue...
... View more
02-06-2018
09:00 AM
|
0
|
29
|
2610
|
|
POST
|
Joshua, the problem is not as trivial as an AttributeError, hence why I added the 'serious ESRI devs only 🙂 For clarification, the parameter type is a GPFeatureLayer but I access the parameter valueAsText and pass it into Describe. Which is the correct ArcPythonic way of doing this. FIDSet is a valid attribute in my test case.
... View more
02-05-2018
04:12 PM
|
0
|
0
|
2610
|
|
POST
|
Hey everyone, It's been ages since i've had to resort to the forums, but the time has come... This is issue is occurring with: 10.3.0.4322 AND 10.5.1.7333 Problem: When a layer is added to the TOC, just as you see in the snippet below, feature selections will no longer be respected (or at least detected) by geoprocessing tools. Description: The symptom of the problem is that obtaining the feature selection count of a geoprocessing layer in a python toolbox is inconsistent. I've pinned it down to some issue with the way Arc (or ArcPy) is handling layers by Name. Here are some snippets: # make this an absolute path to some feature class in a geodatabase, you only need a minimum of two features to reproduce the issue, i'm using polygons. path = #path to your polygon feature class with at least two features in it. mxd = arcpy.mapping.MapDocument('CURRENT') new_layer_name = os.path.basename(path) arcpy.MakeFeatureLayer_management(path, new_layer_name) new_layer = arcpy.mapping.Layer(new_layer_name) arcpy.mapping.AddLayer(mxd.activeDataFrame, new_layer_name, 'BOTTOM') del new_layer del mxd Use the code above in a geoprocessing tool to add a layer to the map. Now, use the code below in a separate geoprocessing tool, to report the number of features selected in the map. desc = arcpy.Describe(input_feature_class) if desc.FIDSet: messages.addMessage('selection made') # you'll never get here with the layer above!! else: messages.addMessage('no selection made') # you'll always get here even with a selection 😞 # count will always be the entire feature class count, since no selection was registered # to the layer.... feature_count = int(arcpy.GetCount_management(input_feature_class).getOutput(0) Notes: - If you use the code above to add the feature class to the map. Remove it from the toc (right click, remove) and add it using arc catalog (drag-drop), the feature selection will STILL not work. Hence why I suggest it has something to do with the internal name resolution. - If you start a new ArcMap instance, add the layer by drag-dropping it from Arc Catalog, the selection WILL work. If you remove this layer and add it using the code above, all subsequent selections will NOT be respected. I look forward to hearing from ESRI support. Let me know if you have any questions, Joseph Armbruster 0Lat Inc, Orlando Florida. joseph.armbruster@0lat.com
... View more
02-05-2018
11:23 AM
|
0
|
44
|
9718
|
|
POST
|
There is no workaround that I could find for this. The best you can do is perform the regular ESRI folder. I've deleted the .dat file and changed the Geoprocessing results to Never Save. ArcCatalog still crashes when opened, but works just fine via ArcMap. Any ideas? Running 10.1 and did use a new tool from Esri before this started. Thanks, sk
... View more
04-24-2014
11:20 AM
|
0
|
0
|
756
|
|
POST
|
Khibma: there is nothing special about the .pyt. We ended up just writing a plugin to force the arc toolbox itoolwindow to close before arc catalog closes 🙂 Ok, looking through our bug queue, these are issues we've fixed in 10.2 or 10.2.1 (which we're working on right now, its not released yet). However, they're easy enough to work around by deleting a file When ArcCatalog opens, the tree opens to one particular folder. Make sure there are no PYTs in that folder. If there are any, move or delete them. You can find what directory this is by looking if the registry if you aren't sure: HKEY_Current_User\Software\Esri\Desktop10.1\ArcCatalog\Settings\LastLocation or Try deleting the ArcToolbox.dat found here: C:\Users\[USER NAME]\AppData\Roaming\ESRI\Desktop10.1\ArcToolbox\ArcToolbox.dat (this will reset your ArcCatalog profile) Hope one of these helps Joseph: could you post your PYT here for us to look at? thanks
... View more
04-15-2014
04:10 PM
|
0
|
0
|
1461
|
|
POST
|
I'm going to create a simplified windows build tonight.
... View more
02-03-2014
11:32 AM
|
1
|
0
|
934
|
|
POST
|
lpinner: If all you need to do is access the File Geodatabase API then this is substantially more lightweight than GDAL/OGR and exposes the original API interfaces (including those for editing). I use GDAL almost every day but in this case I desired a more direct path to the File Geodatabase API.
... View more
02-02-2014
01:42 PM
|
0
|
0
|
934
|
|
POST
|
No clue why they were clipped... now they are correct.
... View more
02-02-2014
11:30 AM
|
0
|
0
|
934
|
|
POST
|
Are you interested in using the File Geodatabase API in Python? Well, wait no more! You can read about it in this post: http://libjoe.blogspot.com/2014/02/python-wrapper-for-esri-file.html And visit the project page here: https://code.google.com/p/file-geodatabase-api-python-wrapper/ Joseph Armbruster
... View more
02-02-2014
08:50 AM
|
1
|
5
|
4915
|
|
POST
|
I have seen several discussions where analysts have been interested in using the File Geodatabase API in Python. Well, wait no more! You can read about it in this post: http://libjoe.blogspot.com/2014/02/python-wrapper-for-esri-file.html And visit the project page here: https://code.google.com/p/file-geodatabase-api-python-wrapper/ Joseph Armbruster
... View more
02-02-2014
03:23 AM
|
0
|
0
|
3935
|
|
POST
|
If you wanted pure-Python automation through the File Geodatabase API, this is now possible. See my post: http://libjoe.blogspot.com/2014/02/python-wrapper-for-esri-file.html You can also check out the project page here: https://code.google.com/p/file-geodatabase-api-python-wrapper/ Enjoy! Joseph Armbruster
... View more
02-01-2014
09:00 PM
|
0
|
0
|
1983
|
|
POST
|
If you need to access the data on multiple platforms, you can use the File Geodatabase API in Python, see: http://libjoe.blogspot.com/2014/02/python-wrapper-for-esri-file.html You can also visit the project page here: https://code.google.com/p/file-geodatabase-api-python-wrapper/ Enjoy! Joseph Armbruster
... View more
02-01-2014
08:55 PM
|
0
|
0
|
351
|
|
POST
|
You can definitely use the File Geodatabase API with Python, read my blog post here: http://libjoe.blogspot.com/2014/02/python-wrapper-for-esri-file.html I only have this working on OSX at the moment but getting this working on linux and windows is trivial. https://code.google.com/p/file-geodatabase-api-python-wrapper/ Joseph Armbruster
... View more
02-01-2014
08:25 PM
|
0
|
0
|
1082
|
|
POST
|
I am currently putting a series of posts together on the topic of scatter. Keep an eye on these to see if they give you any ideas: http://libjoe.blogspot.com/2014/02/scatter-for-terrain-database-generation.html Joseph Armbruster
... View more
02-01-2014
01:15 PM
|
0
|
0
|
580
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-06-2018 12:48 PM | |
| 1 | 02-15-2018 06:51 AM | |
| 1 | 08-29-2013 03:49 AM | |
| 1 | 02-02-2014 08:50 AM | |
| 1 | 02-03-2014 11:32 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-14-2024
05:13 AM
|