3

I'm using modelbuilder to do upstream traces from several points/flags in a feature class. I'm iterating each point in the fc using the feature selection iterator so that I can calculate/transfer the inline variable/point ID to the trace results. My question is, I have the output of the trace tool connected to the collect values tool which then outputs to the merge tool. I want the merge tool to run only after all points have been iterated/traced and output into the collect values tool. I thought this was the point of the collect values tool, that it would hold/collect all iterations and after the iterations were complete, only then would it continue to the next tool. Currently the model iterates through all tools including the merge tool which then puts the error:

Failed to execute. Parameters are not valid. ERROR 000400: Duplicate inputs are not allowed WARNING 000725: Output Dataset: Dataset E:\Workspace\ScratchWorkspace.gdb\Merged_SSO_Assets already exists. Failed to execute (Merge).

I'm guessing this error is due to a merge being performed at each iteration because when I run each tool individually in sequence, the model runs correctly and w/out errors. I've tried using preconditions but they have not resolved the issue, I could be using the wrong preconditions. Model Screenshot

1 Answer 1

4

You need to put the model up to and including the collects value tool in its own model and expose the collects tool as a parameter. Then put that SUB model into a model and connect its output to your merge tool.

10
  • Hornbydd, thank you for the response. I put all elements up to and including the collect values tool into its own model. When I run this model and view the results by "add to display", the results/trace is shown only for the last iterated feature and not all the iterated features. When I run each tool individually and sequentially, however, starting with the iterator-->trace-->collect values, I get the correct results. Additionally, when I right-click the collect values tool and select make variable, the from parameter is greyed out.
    – Steve
    Jan 14, 2014 at 14:12
  • To add to my comment above, when the model is run, it iterates thru each feature but only preserves the last one in the collect values tool.
    – Steve
    Jan 14, 2014 at 16:44
  • 1
    In that case it sounds like you are inadvertently overwriting the output of your select tools, you need to give each layer a unique name and it is these that are collected. What is your select tool? Are you running the select tool to create a new dataset or is it the attribute\location select tool? Hopefully its the Select data tool as selections cannot be stored in the collects tool. You can make the output have unique names by employing inline substitution. In your case just add %Value% to end of file name, this is coming from your iterator.
    – Hornbydd
    Jan 14, 2014 at 21:21
  • If you do not know what inline substitution is then look it up in the help file, it will make much more sense.
    – Hornbydd
    Jan 14, 2014 at 21:23
  • 1
    Hornbydd, I was able to resolve the issue using your suggestions above. I isolated the the iterated portion of the model into a sub-model and then to resolve the features being overwritten, I output them using the unique iterated "%value%". Thanks for your help w/this issue!
    – Steve
    Jan 16, 2014 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.