The validation tab in your script tool properties allows you to put parameters in categories. The help states:
Put parameters in different categories. Categories are expandable window shades with a collection of parameters.
I am using the categories to organize my parameters, so I don't care about the expandable/collapsible feature; it just adds a lot of time to the user. This is all within a normal toolbox, not a script toolbox. v10.1
Does anyone know how to have these categories expanded by default?
Here is my only validation code. I am only utilizing categories. The other parts are the default.
def initializeParameters(self):
"""Refine the properties of a tool's parameters. This method is
called when the tool is opened."""
self.params[0].category = "General"
self.params[1].category = "General"
self.params[2].category = "Inudaciones"
self.params[3].category = "Cienegas"
self.params[4].category = "DrenajesPrincipal"
self.params[5].category = "DrenajesSensillos"
self.params[6].category = "Inudaciones"
self.params[7].category = "Cienegas"
self.params[8].category = "DrenajesPrincipal"
self.params[9].category = "DrenajesSensillos"
return
-
Can you include a link to the Help that you mention, and also state the version of ArcGIS that you are using, please?PolyGeo– PolyGeo ♦2017年01月31日 22:41:30 +00:00Commented Jan 31, 2017 at 22:41
1 Answer 1
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.
-
how on this green earth would you find out this? I am flabbergasted. This is not so well documented!Alex Tereshenkov– Alex Tereshenkov2017年02月02日 10:12:37 +00:00Commented Feb 2, 2017 at 10:12
-
@Alex Modifying the stylesheet to customize a tool has been known about for a while. There's some old documentation here resources.esri.com/help/9.3/arcgisdesktop/com/gp_toolref/… and a few questions here qnd on the Esri Geonet forum. Not sure if there's more up to date documentation. Once you know where to look, it's just a matter of figuring out what html/css needs changing.user2856– user28562017年02月02日 10:29:48 +00:00Commented Feb 2, 2017 at 10:29
-
Sure, but it would take many trial & error attempts before being able to accomplish the task. Wish we had more updated docs on that... Thanks for posting the answer, absolutely brilliant.Alex Tereshenkov– Alex Tereshenkov2017年02月02日 11:08:01 +00:00Commented Feb 2, 2017 at 11:08
-
1@Rex no, not using the xsl transform method. The categories are passed in reordered to begin with. I suggest the simple method of numbering your categories -
self.params[0].category = "1. General"
andself.params[2].category = "2. Inudaciones"
etc...user2856– user28562017年02月03日 00:48:12 +00:00Commented Feb 3, 2017 at 0:48 -
1@ATCH_torn possibly but not easily. The category and non-category parameters are both styled in loops so you'd need to really customise the xsl rather than just changing one bit.user2856– user28562018年07月30日 20:28:03 +00:00Commented Jul 30, 2018 at 20:28
Explore related questions
See similar questions with these tags.