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.
-
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– Baltok2014年02月04日 23:18:02 +00:00Commented 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.user1898629– user18986292014年02月05日 14:20:50 +00:00Commented Feb 5, 2014 at 14:20
2 Answers 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.
-
1Thanks 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.user1898629– user18986292014年02月04日 20:38:29 +00:00Commented Feb 4, 2014 at 20:38
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.
-
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.Dylan Warburg– Dylan Warburg2019年10月14日 21:56:42 +00:00Commented Oct 14, 2019 at 21:56
Explore related questions
See similar questions with these tags.