ModelBuilder CalculateValue into OutputName

777
4
Jump to solution
03-24-2021 10:12 AM
Labels (1)
StanislavaV
Occasional Contributor

Hi guys,

I have another problem with CalculateValue in ModelBuilder.

I have a shp with polygons. Each polygon has one attribute which talks about being a part of group.

So attributes lookes like this

  • FID      CODE       GROUP
  • 1           1001              1
  • 2           1301              1
  • 3            2000             1
  • 4            2302             1

When i run my model I would like to have an output with that value (Group field) in it - something like "Output_1".

I tried different ways for expression in Calculate value tool but no success....

0 Kudos
1 Solution

Accepted Solutions
DavidPike
MVP Frequent Contributor

Just use Iterate Feature Selection (Iterator) grouped by your GROUP field,  then use inline variable substitution with %Value% from the iterator for the Copy Features output e.g. Copy_Features%Value%.  

 

View solution in original post

0 Kudos
4 Replies
DavidPike
MVP Frequent Contributor

Would help if you explained the process/model and what tool the output is formed from - are you using iterate feature selection with it grouped by that GROUP field?  Then what is that iterator connected to?  No idea how to answer your question unless you give more detail.

0 Kudos
StanislavaV
Occasional Contributor

it is a SHP with lot of polygons (more than 2000) ..... each of them has own CODE attribute and then these polygons are in those GROUPS. so some of them have GROUP value 1, another have 2 and so on...

model is pretty basic - input shp, select by attribute and then copy features - i need those polygons belonging to the group value 1 in their own SHP, and so on......because there are lots of groups (so in the end there will be many shp´s) I would like to improve output name of shp by that group value.

0 Kudos
DavidPike
MVP Frequent Contributor

Just use Iterate Feature Selection (Iterator) grouped by your GROUP field,  then use inline variable substitution with %Value% from the iterator for the Copy Features output e.g. Copy_Features%Value%.  

 

0 Kudos
StanislavaV
Occasional Contributor

that´s much more better and simple than "calculate value"! thank you 🙂 

0 Kudos