Select to view content in your preferred language

How to add the default blue warning message in custom Python Toolboxes

68
3
yesterday
AlbertGallego
New Contributor

Hi everyone,

I'm developing a custom Python Toolbox (.pyt) in ArcGIS Pro, and I'd like to include the default blue warning message that appears in many built-in geoprocessing tools. Specifically, the one that says: “This tool modifies the Input Table”, as shown in the snapshot below.

snapshot_blue_warning.png

In ArcGIS Pro tools, this message appears just below the tool's name and above the input parameters. It's very useful to inform users that the tool will overwrite or modify the input data directly.

Is there any official way to enable or configure this message for custom Python tools?
Or is this behavior restricted to tools developed internally by Esri?

Thanks in advance!

Albert

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

It is part of esri's internal tool structure, however, you could "fake" it by adding a boolean parameter as the first parameter.  

name : "proceed"

type : boolean

description : " This tool modifies the input file..  accept to proceed, bail otherwise"

The description is the hover description as described in

Set script tool parameters—ArcGIS Pro | Documentation

Obvious a True would allow one to proceed, False to quit... Perhaps make False the default requiring an overt True selection 


... sort of retired...
0 Kudos
AlbertGallego
New Contributor

Hi,

Thanks a lot for your suggestion and for taking the time to reply. Although it’s not exactly what I’m looking for, I really appreciate your message.

Best regards,
Albert

0 Kudos
GISDepartmentMFM
Regular Contributor

kind of a bodgy way to get what you want is have it so when validate or run is clicked have a tkinter message confirmation popup that tells the user what will happen

response = messagebox.askyesno("Confirm Action", "Are you sure you want to proceed?")
if response: # True if "Yes" was clicked

continue with toolbox if yes was clicked, return otherwise

0 Kudos