|
POST
|
All, I am developing a suite of python script tools in the ArcPro 3.1.0 toolbox (atbx). A set of these tools create a stand alone table in a file geodatabase whose location is known to the tool. The user has no control over name or output location, this is controlled in the script itself. The code runs without error and creates the table as expected. I expose this table created in the script as a derived output as shown below: In my script I create the table, fill it with the required data and add it to the map, I also set the 4th parameter to it, the relevant add to map code is shown below: try:
aprx = arcpy.mp.ArcGISProject("CURRENT")
mainMap = aprx.activeMap
errorTable = arcpy.mp.Table(sPathTable) # sPathTable is a full path to the file geodatabase table
mainMap.addTable(errorTable)
arcpy.SetParameter(4, sPathTable)
except:
arcpy.AddError("Failed to add table to map, this functionality only works if tool is run from within an active ArcPro Project")
return When the tool is run straight from the toolbox, all seems to run OK. If I drag 'n' drop it into a model and then link the derived output to say another tool (in the example below it's an add field tool) the linked tool never validates and the model won't run to completion. I feel its something to do the derived output schema and the Add field tool doesn't know what's linking into it? There is the schema property of a parameter but all the examples in the help I've been able to find talk about setting the schema of an output that is dependent on an input parameter. My parameter is populated with a table built entirely within the script. Does anyone understand what the problem is and can provide any advice? My gut feeling its something that needs to be added to the Validation (ToolValidator code)? Or are derived parameters meant to be "un-linkable"?
... View more
03-31-2023
04:36 PM
|
0
|
2
|
2598
|
|
POST
|
Johannes, Awesome! It never occurred to me that it would be a function of arcpy, I was looking for some sort of read/write property of a geometry. Well you have definitely earned yourself a 🍺 Thank you for your swift reply. Duncan
... View more
03-28-2023
03:36 AM
|
0
|
0
|
5641
|
|
POST
|
All, I'm hoping to tap into the python community for advice on how to efficiently convert a shapely linestring back into an arcpy polyline. I am developing a suite of python tools in the ArcPro 3.1.0 toolbox (atbx). So I read from a file geodatabase polyline geometries and convert them to a shapely linestring. I do this as shapely exposes a useful method on a polyline that does not exist in the arcpy. A simplified snippet of my reading code (which works fine) is shown below: from shapely.wkb import loads
with arcpy.da.SearchCursor(mylayer, ["SHAPE@WKB"]) as cursor:
for row in cursor:
geom = row[0]
line = loads(bytes(geom)) # Convert arcpy geometry into shapely geometry
# Do something with line using shapely
Later on in my code I want to write the processed shapely linestring back into a new Feature Class using an insert cursor. What I cannot work out, hence me coming to you, is how do I efficiently turn a linestring back into an arcpy polyline geometry so I can write it back to a new file geodatabase feature class? In the help file the arcpy polylines take arrays of points when constructing a polyline. I was expecting to find the reverse of the WKB property on a polyline? It seems to me that arcpy allows you to convert from a polyline into alternative ways of recording geometry (json, wkb, wkt) but does not seem to consume them?
... View more
03-28-2023
02:45 AM
|
0
|
2
|
5689
|
|
POST
|
Python is case sensitive, AND does not exist in Python but and does. Suggest you read this page.
... View more
03-27-2023
09:19 AM
|
0
|
1
|
2484
|
|
POST
|
Sounds like your research into the issue is good evidence for an ESRI Idea, to improve the list of identifiable workspace types?
... View more
03-24-2023
03:06 AM
|
1
|
1
|
3968
|
|
BLOG
|
To anyone who has ended up at this thread. With every major release of ArcPro spyder gets broken or something does not work and it's a monumental effort it trying to get spyder working with arcpy/arcpro. I recently upgraded to 3.1.0 and against everything got blitzed and things just stop behaving as expected. So I have official given up using spyder (shame its a great piece of software) and started using VScode as discussed in this thread. So far VScode installed OK, worked first first and seems to be working OK... So my advice is abandon spyder and start using VSCode, its a lot less stressful...
... View more
03-22-2023
04:47 AM
|
4
|
0
|
14698
|
|
POST
|
What does it look like on the map, we have nothing to compare it with, so to me what you show is ok?
... View more
03-22-2023
04:35 AM
|
0
|
1
|
1009
|
|
POST
|
This is possible certainly in ArcPro 3.1.0. Here is an example for a default setting for a raster added to the map: Clicking the invert option simply inverts the symbol as shown below, but not the labels: You need to set the stretch type to min/max, note new tick box options appears in symbology pane. Tick on edit min/max values, swap the values around and hey presto you get your low - high labelling as desired Although I show you a solution I think in the case of this elevation dataset it does not make sense, so be careful when inverting values/labels to make sure what you are showing is understandable to the map reader.
... View more
03-22-2023
03:40 AM
|
2
|
0
|
3842
|
|
POST
|
What are "election profiles"? Edit your question show some images of what you have and why its failing for you.
... View more
03-16-2023
10:00 AM
|
0
|
1
|
1180
|
|
POST
|
I see you are using arcpy.da.Describe which having read the Help file I've discovered that you use this if you want results in a dictionary format. I've never ever used that approach and I wonder if you don't need your description as a dictionary object then maybe you can use arcpy.Describe() instead? This is the approach I use and have never had any issues with. If it is a bug as hinted by other responders, then if you need to resolve this quickly, I would suggest you explore the use of arcpy.Describe().
... View more
03-16-2023
09:55 AM
|
0
|
4
|
3294
|
|
POST
|
I'm using 3.1, may be time to upgrade, there are many benefits such as bug fixes and new functionality.
... View more
03-16-2023
09:43 AM
|
0
|
1
|
2567
|
|
POST
|
I tested this (personally I tend not to use template projects) and my experience was not the same. If saving a project and using that as the "template" that is the wrong way of doing it. You need to create an APTX file, this is document here and when accessed it created a new default geodatabase and any data within it. My layers were not point back to the original geodatabase. So I'm going to guess you tripped up on something?
... View more
03-16-2023
09:37 AM
|
0
|
3
|
2573
|
|
POST
|
You don't say anything about how the time is stored, as you show it, it could be as a string, so summing a string makes no sense. You need to edit your question and add more detail, especially data format and what it is you are doing.
... View more
03-16-2023
09:19 AM
|
1
|
0
|
1948
|
|
POST
|
Ahhhh! I did not have the layer selected in the legend in the TOC, so that option did not appear. Nice one, thank you so much! Here is a well deserved virtual 🍺.
... View more
03-14-2023
03:43 AM
|
2
|
0
|
8148
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-03-2026 07:31 AM | |
| 3 | 06-29-2026 05:17 AM | |
| 1 | 02-15-2023 05:45 AM | |
| 1 | 06-16-2026 02:37 AM | |
| 1 | 06-15-2026 08:29 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-07-2026
10:17 AM
|