Macros in ArcGIS Pro?

5089
16
07-26-2016 03:59 PM
HectorBorro1
Deactivated User

Hi, Anyone knows how to run an automated process?

I need to to the following 280 times:

  1. select layer by attribute
  2. clip
  3. Label
  4. Change label field
  5. Symbology: Graduated Colors
  6. Change Field
  7. set Method: Quantiles
  8. set Clases: 5
  9. set Color Scheme

Many thanks for any guidance!

Tags (2)
0 Kudos
16 Replies
LeileiDuan1
Occasional Contributor

It's like LR mentioned above, ModelBuilder only allows one iterator. To use another iteration you have to build another model and integrate them together by dragging and dropping one model into the other. In my case, I made the first model output a precondition to the second model.

Looks like you already figured out the second iterator. It seems that Apply Symbology From Layer works if you add a step to make sure that the input is a layer file. (Mine is not valid because I don't have a symbology layer put in)

HectorBorro1
Deactivated User

great, thanks!

looks we are on the right direction...

I ran it, but I get some error messages. Any idea what may be causing them? It seems the Select layer by attribute is not the same value as

Here's the log:

     Executing (Iterate Row Selection): IterateRowSelection "Polygons" "STORE#" true

     Start Time: miércoles, 27 de julio de 2016 15:50:56

     Executing (Make Feature Layer): MakeFeatureLayer "Polygons" "I_Polygons_STORE" ""STORE" = '3421'" # #

     Start Time: miércoles, 27 de julio de 2016 15:50:56

     Succeeded at miércoles, 27 de julio de 2016 15:50:56 (Elapsed Time: 0.03 seconds)

     Succeeded at miércoles, 27 de julio de 2016 15:50:56 (Elapsed Time: 0.05 seconds)

     Executing (Select Layer By Attribute): SelectLayerByAttribute "I_Polygons_STORE" "New selection" "STORE= 3421" NON_INVERT

     Start Time: miércoles, 27 de julio de 2016 15:50:57

     The process did not execute because the precondition is false.

     Succeeded at miércoles, 27 de julio de 2016 15:50:57 (Elapsed Time: 0.00 seconds)

     Executing (Clip): Clip "I_Polygons_STORE" "Factor INDIVIDUAL nacional" "C:\\Output\Layers\CL3421_IND_auto.shp" #

     Start Time: miércoles, 27 de julio de 2016 15:50:57

     All the inputs are not current.

     Succeeded at miércoles, 27 de julio de 2016 15:50:57 (Elapsed Time: 0.00 seconds)

0 Kudos
HectorBorro1
Deactivated User

Quick update:

With your previous idea Leilei Duan​ of Make Feature Layer, I incorporated it into the first model. So there is no need to nest 2 models!

Now the question is what are your parameters for Selecting Layer by attribute? I can't seem to create the expression based on the STORE attribute

it seems that I can't build an expression as it has no input until it runs....

0 Kudos
LR
by
Frequent Contributor

Right-click "Select Layer By Attribute" --> Make Variable --> From Parameter --> Expression. Then mark the expression bubble as parameter. This should give you an expression field when you run your model. The query builder should be populated with your selected data's attribute fields.

0 Kudos
HectorBorro1
Deactivated User

I found that when doing an iteration by rows there is no need to select by attributes as the attribute I'm interested in selecting is the one that is being itereated, so it is a duplicate process and can be removed...

0 Kudos
XanderBakker
Esri Esteemed Contributor

As a side note, also have a look at Tasks: What is a task?—ArcGIS Pro | ArcGIS for Desktop This provides a more interactive way of automating workflows.

LeileiDuan1
Occasional Contributor

Hector can you send me a sample of your data so I can help you the best way I could? You should be able to send me messages since I just followed you.