POST
|
The Field in ModelBuilder is a Field object and cannot be used 'as is' in an expression using the inline varaible syntax within double-quotes. To make it works, within ModelBuilder you should use the Calculate Value tool in Utilities and simply use "%Field%" expression, asking to get the Field name as a string. Then, you can use this calculated result as an inline variable. Here below is the working example. Hope this helps!
... View more
06-11-2024
01:27 AM
|
0
|
0
|
73
|
POST
|
Hi, In the Imagery tab, I used the Raster Functions -> Data Management -> Mask in order to 'mask' unwanted pixels, as shown below. Although, you seem to have lots of unwanted pixel in your example. I would recommend to reclass your raster beforehand to 'group' all unwanted pixels together. Hope this help
... View more
05-13-2024
02:48 AM
|
0
|
0
|
526
|
POST
|
Strange! It took a while for me to identify the issue. I cannot really help but I would recommend to open the *.pitemx items in either ArcGIS Desktop (ArcMap) or on another machine with another account to ensure the items resources do work. If it works, there is an issue with you login and/or ArcGIS Pro installation.
... View more
04-17-2024
01:18 AM
|
0
|
0
|
286
|
POST
|
Hi Marcelo, Just found your post here and perhaps you can advise me. In ArcGIS Pro 3.2.1, I have large models in ModelBuilder with 4-5 Python scripts embedded as tools and I am looking for an efficient AWS EC2 machine to run my models (way) faster. So far, I tried an EC2 r6a.4xlarge and I am rather disappointed. A model running in 1h01 on my laptop took 1h15 on this virtual machine. It does not make sense as this r6a.4xlarge has 16 vCPU with 128 GiB vs 4 CPUs with 32 Gb. In theory, I guess I don't need GPUs but would it help to select a GPU enabled virtual machine?
... View more
01-25-2024
05:45 AM
|
0
|
0
|
787
|
POST
|
Hi, In a Python script, I use arcpy.da.UpdateCursor but I need to read/write into rows using field names and not indexes, because fields to update are given as a parameter by the user. When creating the update cursor, I select all fields '*' in order manipulate any fields. However, it is a pain to read/update rows using indexes (dozens of fields)! I know rows are tuples but I really need to access fields using field names. I spent time looking at documentation and posts but cannot find any proper syntax. Help would be appreciated
... View more
12-12-2023
08:54 AM
|
1
|
3
|
602
|
POST
|
Thanks Dan for the quotation "models set overwriteOutputs to False"! It helped me to understand why a model could not overwrite outputs, despite having correct Geoprocessing settings for the ArcGIS Pro application... For info, if a model embeds some custom Python tools and without explicitly setting overwriteOutputs = True, as models set overwriteOutputs to False by default, it also defaults the entire model to False (not only the python script). Good to know!
... View more
11-27-2023
01:10 PM
|
0
|
0
|
910
|
POST
|
Thanks for looking at this post. The content of the expression variable is the second line of the code, as below: [["Detached", "!Detached!*!Ratio!", ""], ["Total", "!Total!*!Ratio!", ""]] As you mentioned, the CalculateFields is expecting a Value table and here I tried to built a string. In fact, I tried to reuse the syntax provided when you export ModelBuilder to python... hence the [0] which I do not either understand its use. As for error message, on runtime, Python simply ignore the CalculateFields! As I said, using arcpy.management.CalculateField in a loop is an excellent workaround, using simple string variable (no need for Value table)
... View more
11-27-2023
08:26 AM
|
0
|
0
|
427
|
POST
|
Hi, In case you get same error when opening ArcGIS Online .pitemx items on ArcGIS Pro, ensure you are logged into ArcGIS Online account. It looks silly but it now works for me. Usually, I am logged in internal portals and this prevents opening ArcGIS Online .pitemx items! Please ESRI, provide a more informative error message in this situation. In comparison, ArcGIS Desktop (ArcMap) do not display errors when opening .pitem items if not logged in.
... View more
11-27-2023
02:01 AM
|
0
|
1
|
509
|
POST
|
I found a workaround... Instead of dealing with building an 'expression' string variable in a for loop to calculate all fields with CalculateFields, I am calculating fields directly in the for loop, one by one with arcpy.management.CalculateField. It is just as good and the syntax is much easier!
... View more
11-22-2023
08:59 AM
|
1
|
0
|
492
|
POST
|
Hi, I have a simple script using CalculateFields geoprocessing tool. As part of my script, I build an expression in a loop for fields to calculate. However, it is not working... If I use hard-coded field names and expression for calculation, it works. Why my 'expression' string variable is not working? It is exactly the same as the hard-coded string... arcpy.management.CalculateFields(in_table=fc, expression_type="PYTHON3", fields=[["Detached", "!Detached!*!Ratio!", ""], ["Total", "!Total!*!Ratio!", ""]])[0]
arcpy.management.CalculateFields(in_table=fc, expression_type="PYTHON3", fields=expression)[0]
... View more
11-22-2023
06:50 AM
|
0
|
3
|
589
|
POST
|
Hi, I designed a model in ModelBuilder which is using a For loop to loop through years... And using the years to make Layer by Attribute selection. As the variable 'Value' (which represents the years) is changing during run-time of the model with the 'For' loop, I need to use this variable 'Value' as an inline variable (enclosed in percent signs) in the expression to make the Layer by Attribute selection. However, the geoprocessing tool Layer by Attribute do not accept the inline variable. Instead, I tried to use a Calculator Expression variable, but it does not seem to work either. Is there any way to use an inline variable to make a Select by Attribute expression?
... View more
11-03-2023
05:32 AM
|
0
|
0
|
267
|
POST
|
Hi, In the steps you went through, you are actually updating the Default symbol of the Annotation Class... meaning you are updating the 'template'. Not the actual Annotation. In practice, if you create a new annotation using this 'template', you should get the color you selected. Conceptually, all annotations (objects if you prefer) point to Annotation Classes which come from the label classes from the feature layer you converted to Annotation. Then, you can change some properties of annotations (such as color) individually and in that case the annotation do not point to the 'template' any more. It makes annotation maintenance more difficult if many. Good practice is to keep the label classes as tidy as possible before converting to Annotation. Some background here: https://pro.arcgis.com/en/pro-app/3.0/help/mapping/text/display-geodatabase-annotation.htm Hope this help
... View more
11-01-2023
03:32 AM
|
0
|
1
|
1224
|
POST
|
Hi, In the ModelBuilder below, I iterate through some fields, using Iterate Fields, which I intend to calculate with Calculate Fields. I use the Field variable as a 'Precondition' in Calculate Fields and the feature class as 'Input Table'. I understand the variable Field is a field type and populate the Field Name in Calculate Fields correctly. However, I need to 're-use' this variable Field as an inline variable in the Expression enclosed in %. Of course, the syntax is not valid and I cannot figure out how to fix it. Any help appreciated.
... View more
11-01-2023
03:16 AM
|
0
|
2
|
392
|
POST
|
Hi, If this 'one-to-many' join is not solved, you can use the Spatial Join (Analysis) geoprocessing tool: https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/spatial-join.htm#GUID-F9111853-D7D3-42C5-A53F-4B035A8548C0 which do perform 'one-to-many' spatial join (ensure your features class and tables are in a geodatabase as standalone shapefiles and tables do not usually perform 'one-to-many' joins). The Add Spatial Join (Data Management) do not permit 'one-to-many' joins. Hope this helps.
... View more
10-03-2023
06:03 AM
|
1
|
0
|
823
|
POST
|
I think I found out the reason why global variable $layer gives an Object not found error. In Field Calculation profile, only $feature and $datastore can be used in Aracde. Not $layer. https://developers.arcgis.com/arcade/profiles/field-calculation/ As I use this this Arcade expression in Field Calculation in ModelBuilder with a dynamic feature class name, I have no chance to re-use the ModelBuilder variable pointing to my feature class in the Arcade script... Never mind, I will perform my calculation differently.
... View more
08-18-2023
01:11 AM
|
0
|
0
|
352
|
Title | Kudos | Posted |
---|---|---|
1 | 12-15-2022 03:32 AM | |
1 | 05-24-2018 02:11 AM | |
1 | 12-12-2023 08:54 AM | |
1 | 11-22-2023 08:59 AM | |
1 | 10-03-2023 06:03 AM |
Online Status |
Offline
|
Date Last Visited |
06-11-2024
02:03 PM
|