Getting desired "field" from the user and iterate it values for calculation with another field in another layer in model builder

381
6
05-19-2017 10:54 AM
DilanSankalpa
New Contributor II

I developed a model and in one part of its process, it multiply two fields of two shape files. Here user should be able to enter one of the desired field in one shape file and other filed will be selected automatically by the model. To get the user input of desired field, I used a script inside the model and it worked successfully. But unfortunately I later found out that it doesn't work in other machines unless location of the script is specified. I want to distribute my model to my co workers and it should be work with the inputs given in the model interface without editing it. So I am wonder if there is any alternative way to make my model work in any machine without using a script inside the model or is there a way to have a variable in the interface to specify the location of the script?

0 Kudos
6 Replies
DanPatterson_Retired
MVP Esteemed Contributor

Do you have any model parameters in your model? (ie P 's)

0 Kudos
DilanSankalpa
New Contributor II

Yes there are few. and I want one of the model parameter to be field that user have the freedom to select

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Ok... is it? Did you go through setting up a field filter? You can right-click on the various steps in the model and expose other options which can be made into parameters etc.  The documentation is pretty good with examples

DilanSankalpa
New Contributor II

Yes but my issue is not with filed type. I used a script to specify the field inside model builder. But when I run it in another computer it shows broken. So is there a way to specify the location of the script inside the model at the interface without editing it?

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

if you have two shapefiles involved in a multiply, and they are inputs, did you right-click to make them parameters and then Click Make Variable > From Parameter > to see if a field shows up as a possible selection?  Perhaps an image of your model is needed, since there should be a field from each shapefile exposed as a parameter to be used in the multiplication

0 Kudos
ScottMoyer
Occasional Contributor

Some suggestions. With either of these, resource your model script tool to the new location (right click script tool, Properties, Source). #1 - put the script in a common area that your coworkers have access to on your LAN. You may have to use a UNC path. #2 - have users put a copy of the script in something like C:\Program Files (x86)\ArcGIS, that all users have.

0 Kudos