Is it possible, perhaps in the validation script of a tool, to enable a category to be open by default on opening the tool? The user always has to expand the category to see the included parameters but I'd like to have it open by default.
Solved! Go to Solution.
Hi Matt
I think the behaviour of a Category is for it to be 'closed' by default. I think the reason is to save space on the form to hold optional arguments. As you are probably aware, optional arguments in the category should have a default value (where appropriate) and you should not include mandatory / required arguments.
Probably not the answer you were hoping for but it probably conforms your assumptions.
many thanks ed
Hi Matt
I think the behaviour of a Category is for it to be 'closed' by default. I think the reason is to save space on the form to hold optional arguments. As you are probably aware, optional arguments in the category should have a default value (where appropriate) and you should not include mandatory / required arguments.
Probably not the answer you were hoping for but it probably conforms your assumptions.
many thanks ed
If the newer .atbx toolboxes can use a custom xsl stylesheet (I don't know...), then this old ArcGIS Desktop answer might be useful:
Controlling Categories in Script Validation Tools - Expanding Groups By Default
This isn't possible in python, but you can by using a custom stylesheet.
Copy "C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Stylesheets\MdDlgContent.xsl" to the same folder as your script.
Edit line 467 to remove STYLE="display:'none';", i.e. change:
<DIV ID="{PropertyGroupName}" STYLE="display:'none';" onclick="window.event.cancelBubble = true;">
to
<DIV ID="{PropertyGroupName}" onclick="window.event.cancelBubble = true;">
Then in your script tool properties, set the stylesheet property to your edited.xsl.