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.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Feb 4, 2014 at 16:50
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? Commented 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. Commented 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.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
answered Feb 4, 2014 at 20:24
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. Commented 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.

answered Apr 15, 2015 at 11:59
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. Commented Oct 14, 2019 at 21:56

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.