POST
|
I am building up a nested model that iterates through N feature classes (point shapefiles) in order to calculate statistics for field X and get the minimum value for each feature class. So far so good. The iteration includes the model tool Get Field Value to extract the minimum value from the summary statistics and the Collect Values Tool to collect the values (Zmin, see figure below). It works properly. Next step would be to extract the minimum out of the N collected values (Zmin) and use it as a parameter in the main model: The output of the nested model (Zmin) is returned as multiple values: I have tried to use the Calculate Value Tool applying the following function: Expression: lowest("%Zmin%") Code Block: def lowest(Zmin): Zmin.replace(";",",") Zmin.split(',') LowestLine = min(Zmin) return LowestLine Data Type: Double It only returns '-', thus something is obviously wrong in the code but I cannot figure out what, due to my limited Python skills. Any help would be very much appreciated! Thanks in advance.
... View more
01-15-2019
12:34 AM
|
1
|
2
|
408
|
POST
|
I have a Map Document with data driven pages set up based on Dataframe no. 1. On the same document, Dataframe no. 2 shows data related to the former, but with a different extent; page definition of its layers are already set up to show only the relevant features of each page. I have tried to create an 'index layer' for DF no.2 in order to set its extent, but if I use a fixed extent and specify that it should be based on the outline of visible features of this index layer, than the extent is fixed in each page and based on the feature visible in page 1. Is there any walk around to this issue? I have some limited python skills, but I could not find anything really helpful when I tried to google it. Any suggestion, documentation, link, etc. is very welcome!
... View more
12-14-2018
07:51 AM
|
0
|
0
|
197
|
POST
|
Thanks for your help! By the way, I have noticed that if I ran the code in ArcMap, it used the VBScript parser for the label expression, as you wrote. However, when I integrated it into a model, it appeared that through the model the parser was automatically set to Python. I have not found a proper explanation for that, though.
... View more
11-06-2018
01:47 AM
|
0
|
1
|
2321
|
POST
|
I have a point feature class for which I want to show labels based on a numeric "Field". My labels have to be rounded to the second decimal place and I need to have them padded with zeros. I know that I can manually modify it through the Layer Properties, but I need to write a script for that. I have tried to run the following code, also based on other posts, but I end up with no labels at all: import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") layer = arcpy.mapping.ListLayers(mxd, "Layername")[0] if layer.supports("LABELCLASSES"): for lblClass in layer.labelClasses: lblClass.className = "Field" lblClass.expression = "Field".format("%.2f") layer.showLabels = True I wonder whether I have missed some steps. Thanks in advance for your help!
... View more
10-30-2018
06:39 AM
|
0
|
3
|
3241
|
POST
|
It seems it doesn't solve the problem. By the way %n% works fine when I run the first model alone.
... View more
10-11-2018
03:45 AM
|
0
|
2
|
464
|
POST
|
It is the directory where the folder 'points' (see first fig in the original post) is located. I need the model to be the most general possible, as I have to share it with other colleagues.
... View more
10-11-2018
03:14 AM
|
0
|
4
|
464
|
POST
|
That's the workspace where the original tables are located.
... View more
10-11-2018
03:00 AM
|
0
|
6
|
1554
|
POST
|
Thanks for your suggestion! It still doesn't work, as it seems that the fact that during the model the variable 'out_stats_%N%.dbf' is manipulated several times generates some kind of conflict when I run it as submodel. I cannot set them as intermediate variable (which I guess would solve the problem); I have read in some other post that that would be possible by setting the environment, but I am not so far with Model Builder and I would not know what to change. I would be very grateful if you could help me!
... View more
10-11-2018
01:09 AM
|
0
|
10
|
1554
|
POST
|
Thanks for your suggestion. The first model works properly and returns N output tables; if I apply the merge tool to the output tables it works, too, but for some reason I cannot combine the two into one model in order to automatize the process. There was a similar question some time ago (Merge all iteration output to single output in modelbuilder), but it doesn't work either.
... View more
10-08-2018
12:32 AM
|
0
|
1
|
1554
|
POST
|
I am running a model iterating through N feature clases and I get N tables as output. The model works properly. Here it is: I need to merge this tables into a new one, thus I would run my model as submodel. However, when I add it to the new model something goes wrong: I am still learning modelling and programming skills, thus any help, suggestions, clarifications are more than welcome!
... View more
10-05-2018
05:28 AM
|
0
|
15
|
2301
|
Title | Kudos | Posted |
---|---|---|
1 | 01-15-2019 12:34 AM |
Online Status |
Offline
|
Date Last Visited |
11-17-2020
05:17 AM
|