2

I have been working with ModelBuilder and I am having trouble placing a precondition on an input parameter. However, I may be going about it in the wrong way and may just need a Python script.

My example will be based off of the 'Strip Map Index Features' tool (Cartography Tools --> Data Driven Pages --> SMIF) in ArcMap. When running the tool, the GUI shows a checkbox (Use Page Unit and Scale). There is also another parameter/textbox (Map Scale). The 'Map Scale' text box only becomes active or enabled when the checkbox is checked.

I am trying to recreate this functionality using ModelBuilder and I am not sure how to do so.

2
  • So, you want the tool to gray out a parameter input when the checkbox is unchecked, and then to ungray/allow it when it's checked?
    – Baltok
    Feb 4, 2014 at 23:18
  • Yes, well reverse that. THe checkbox starts out as being unchecked. Once you check it, then the parameter becomes enabled or un-grayed out. When you uncheck the box, the parameter goes back to being grayed out / disabled. Feb 5, 2014 at 14:20

2 Answers 2

2

You can add a checkbox that you can use as a precondition in ModelBuilder as follows.

In ModelBuilder - Insert - Create variable - then select "Boolean" - if you then make this a parameter it will appear in the model window as a check box. You can rename it and use it as a precondition to sections of the model.

1
  • 1
    Thanks for your input, but that part is already understood. I have a parameter that is a boolean that does appear on the model window. My confusion is how to make another parameter enabled/disabled depending on whether that checkbox (boolean parameter) is checked or not. Feb 4, 2014 at 20:38
0

You have to customize script tool behavior. Take a look at Customizing script tool behavior. But beware, it can be quite frustrating until you get it to work correctly.

1
  • Is it possible to customize tool behavior in this way for Model-Builder tools? I thought this option is only available if the tool is written in a Python script. Oct 14, 2019 at 21:56

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.