1

I'm using ArcGIS Desktop 10.6 and have a model as shown in the image below. I'm calling it option 1. The model exports GIS data to CAD DWG format and is comprised of two submodels, "Setup" and "Export". I'm going to be setting up a second model (although I may house it within this model), option 2, also exporting GIS data to DWG but with different configuration options.

How can I configure ModelBuilder so when the model is run, it will offer a choice of option 1 or option 2 and then based on the choice, it will run the respective path?

I have no Python experience, therefore, am trying to do it in ModelBuilder. Python suggestions are welcome as I'm not sure if this is even possible to do in ModelBuilder. I was experimenting with the Boolean variable as you can see in the screenshot but am not sure how to configure it.

enter image description here

2

Although if-else statements are not as user-friendly as they should be in Modelbuilder, Esri did develop the 'If Field Value Is' tool to do this kind of logical selection. Esri Document on 'If Value is' tool

  • Liam, thank you for the reply. I think I'm a little closer. I've setup the two inputs as a string parameter with a value list. Now I need something that will read the input and then direct the model. It sounds like the if value tool might do this but reading the link, it says its intended for field values (which mine is not). Furthermore, I'm not sure how to incorporate the tool into modelbuilder. If you can point me in that direction, I will give it a try. – Steve Jun 15 at 0:16
  • I should add, I don't have ArcGIS Pro. – Steve Jun 15 at 1:25
  • The string parameter wasn't going to work so I'm back to using the boolean variable. The variable says check to run option 1 or leave unchecked to run option 2. Still not sure how to read the boolean and then relay to the rest of the model. – Steve Jun 15 at 1:54
  • 2
    Hi Steve, I did not realize that was an ArcPro tool, the only way to do an if-else (true/false) test in ArcMap is to write in a script tool to your model. Although this is not the best for someone new to python it is possibly the easiest script to write and Esri has published a tutorial to do it. In this tutorial, the author includes a downloadable model containing the examples so if you wanted you could just borrow their script tool and apply it to your model. – Liam Jun 17 at 15:35

Your Answer

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

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