|
IDEA
|
I have been having issues getting the network tools to work in ModelBuilder, things are not consistently validating and some tools like Set Attribute Value are not validating in ModelBuilder at all. USE CASE: ModelBuilder is a great tool for building simple workflows that requite multiple tools, for example: disable network, add a field and then set it as a network attribute, and enable again. Also, if you can get model builder parameter validation working right, it will work well from anywhere! 🙂
... View more
03-23-2021
04:31 PM
|
0
|
1
|
1425
|
|
POST
|
This is a complaint and a workaround I ran into with the Trace Network. First I want to say this is great and looking forward to more from this new functionality! I have found that adding points when clicking on the map is very slow (sometimes, not always). If I wait a long time (30 seconds) the point shows up. I have a workaround however, if I select an feature and click the other button (Add selected) that works instantaneously. Just a report for the trace network team. Thanks again for the tool @JonDeRose -- clearly your team has been re-imagining the interface with the Pro design in mind and it's looking quite "Prothonic" to me (that's a compliment) as I convert old Geometric Network tutorials to the new tool.
... View more
03-23-2021
04:26 PM
|
0
|
2
|
1799
|
|
POST
|
Thank you Jon! This morning I got my students started on their brand new lab (upgraded from Geometric Networks to Trace Networks for this year's edition. Looking forward to the trace network improvements as time goes on, I know it's a new thing so we will want more functionality but I like the design so far. Everyone, be sure and check out Jon's blog post about the trace network. So glad Esri has managed to get this done - the trace network is especially useful to me for teaching students about network analysis without the overhead of the Utility Network, and doing analysis with the USGS NHD and NHDPlus though I'm sure others are glad to see it for other reasons. https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/introducing-the-trace-network-with-arcgis-pro-2-6/
... View more
03-23-2021
04:20 PM
|
0
|
0
|
1926
|
|
IDEA
|
I don't see a vote-up button anymore, but if I could I would! I Kudo's and will follow it!
... View more
03-23-2021
03:31 PM
|
0
|
0
|
7358
|
|
POST
|
Did you look for the model in the Analysis > History ? Not sure it would show up there since it's a different thread?
... View more
03-23-2021
12:49 PM
|
0
|
1
|
4240
|
|
POST
|
Hi everyone again. I just got around this error by specifying the Path Direction. I have a bug logged to Esri that Path Direction and Shortest Path Network Attribute name should be set by parameter validation to be required properties when Trace Type is set to Shortest Path. Neither are. If I leave out Path Direction I get the dreaded 999999 error. If I leave out Shortest Path Network Attribute name I don't get a validation error, the tool runs and I get a error message. It baffles me why this wasn't done when this tool validation was written by Esri! It's pretty basic parameter validation. To the point of annoyance!
... View more
03-21-2021
09:14 PM
|
2
|
0
|
1996
|
|
POST
|
I have tried rebuilding the network. Find connected works, but shortest path errors with 999999. This was working when i was preparing a lab for my students a month ago but not at all now. I think I'm going to have to go back to ArcMap this week. 😞
... View more
03-21-2021
08:34 PM
|
0
|
3
|
2007
|
|
POST
|
Here is how that works with the tool: inTable = "C:/Data/A3_Large_projects/Fuelloadmodels/Data/GDB/Yr2021.gdb/combo"
fieldName = "Bark_load"
expr = "t_RF(!Bark_r!, !Bark_k, !Bark_c!, !since_fire!)"
cblock = """
def t_RF(rr, kk, cc, sfire):
import math
if sfire >= 0:
return (
7.437 /
( 1 + 937.8 * math.exp(-1.905 *
(rr * (1 - math.exp(-kk * sfire)) + cc )))
)
else:
return 999 """
arcpy.CalculateField_management(inTable, fieldName, expr, "PYTHON_9.3", cblock) I should mention that arcpy.da.UpdateCursor is a more common way to do this with complex field calculations in Python (less overhead): inTable = "C:/Data/A3_Large_projects/Fuelloadmodels/Data/GDB/Yr2021.gdb/combo"
fieldName = "Bark_load"
def t_RF(rr, kk, cc, sfire):
import math
if sfire >= 0:
return (
7.437 /
( 1 + 937.8 * math.exp(-1.905 *
(rr * (1 - math.exp(-kk * sfire)) + cc )))
)
else:
return 999
with arcpy.da.UpdateCursor(inTable,
["Bark_load", "Bark_r", "Bark_k", "Bark_c","since_fire"]) as rows:
for row in rows:
bark_load, rr, kk, cc, sfire = row
row[0] = t_RF(rr, kk, cc, sfire)
rows.updateRow(row)
... View more
03-17-2021
05:10 PM
|
0
|
0
|
3771
|
|
POST
|
Dan: the VB function and Raster tool Exp is "e to the value" not ^ (VB) or ** (Python)
... View more
03-17-2021
04:48 PM
|
1
|
1
|
3772
|
|
POST
|
1. filling attributes with predefined values < editing templates and domains are really good for this 2. make queries from combo boxes < I have been successful doing this with python tool parameter properties and (updateParameters) parameter validation. But I get that .NET is the best (only) way to totally control a user interface if required!!
... View more
03-17-2021
04:28 PM
|
0
|
0
|
1851
|
|
POST
|
This is a raster dataset? You are using Calculate Field, it so sounds like !Bark_r!, !Bark_k!, !Bark_c!, !since_fire!) are all fields in a raster table. (Combine output?) If that's the case, math.exp should be used not Exp here. >>> import math
>>> math.exp(1)
2.718281828459045 However, if I am wrong and these are rasters, not fields in a table, @DanPatterson is correct and you should be doing something like from arcpy.sa import *
outraster = 7.437 /(1+937.8 * Exp ( -1.905 * Bark_k ...
... View more
03-16-2021
09:41 PM
|
1
|
2
|
3819
|
|
POST
|
I am tempted by @Anonymous User but what if I want to replace three characters? Too many .replace()'s and it starts to get darn un-Pythonic. I don't know why @DanPatterson did not go there with reg expressions. They are just so beautiful... >>> import re
>>> text = foo!+bar'
>>> re.sub('[!+]', '-', text)
'foo--bar'
>>> re.sub('[!+].', '-', text)
'foo-bar'
... View more
03-16-2021
09:18 PM
|
2
|
3
|
3762
|
|
POST
|
I'm guessing: lyrFile = arcpy.mp.LayerFile(file) The code above it (apparently) builds the full path to the lyrx files in a list and loops through them one by one. This updateConnectionProperties method has some pretty fancy syntax options using dictionaries, so I can't vouch for this untested code. (I haven't had time to whip up code which is why I simply pointed you to the relevant doc pages.)
... View more
03-16-2021
06:05 PM
|
0
|
3
|
7924
|
|
POST
|
1. That's a bug, @nita14 meant to put the variable file in the place of the .lyrx path. 2. Yes, for both these items, see the documentation for the LayerFile object and its updateConnectionProperties method.
... View more
03-16-2021
04:47 PM
|
0
|
5
|
7929
|
|
POST
|
If you want to batch modify a bunch of lyrx files the way to do this is using ArcGIS Pro's mapping module, arcpy.mp. In Python you can read each lyrx, modify its source, and overwrite the lyrx with the updated source. https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layerfile-class.htm A useful arcpy method to find all the lyrx files and loop through them is arcpy.da.walk(): https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/walk.htm
... View more
03-16-2021
01:17 PM
|
1
|
0
|
7953
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-11-2021 01:26 PM | |
| 5 | 12-10-2021 04:58 PM | |
| 1 | 02-27-2017 09:30 AM | |
| 2 | 12-04-2023 01:05 PM | |
| 1 | 04-12-2016 10:17 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-19-2024
12:10 AM
|