I'm attempting to add rasters to a new mosaic dataset in a new file geodatabase, all in the same model. However, the Add Rasters To Mosaic Dataset tool does not recognize the NewMosaicDataset or the NewGDB.gdb because they haven't been created yet. The first time the model is run, the geodatabase and mosaic dataset are created but no rasters are added, but the Add Rasters tool then recognizes an existing geodatabase and mosaic dataset. The second time running the model is unsuccessful because the geodatabase already exists and it will not overwrite it.


This is the error produced when I open the Add Rasters To Mosaic Dataset tool.
(Ignore the digit 1 after NewGDB in the error message, I simply entered a new output name in order to take a screenshot of the error message I receive)


I have attempted to set the output mosaic dataset as a precondition as well as exporting the model to a Python script and adjusting variable names, but both attempts were unsuccessful for the same reasons described above.

Would like to know how to do all of this in one model.

  • That's interesting. So it's not picking up that the model will create that mosaic dataset. Are you any good at python? if so export to a script and it should run just fine. – Michael Stimson Mar 10 '15 at 4:53
  • I exported this to a script and it worked this time. I must've had something entered incorrectly in my previous script attempts. Still rather annoying that the ModelBuilder isn't functioning properly. I appreciate your help, lots of scripting to do now that I can't use ModelBuilder. – nokalake Mar 10 '15 at 5:22
  • All you need to do is put in a script tool into modelbuilder. I suspect that the add rasters tools' validate function isn't working so well. If your script contains only add rasters to mosaic dataset then its validate will take over and you wont have that problem. That's a quick fix, in the end it's probably worthwhile to learn arcpy - at least the fundamentals. – Michael Stimson Mar 10 '15 at 5:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.