Python Tools

  SuperMap iDesktopX enables tool customization through Python language, allowing users to develop functionalities that better align with business requirements. Meanwhile, some tools in the toolbox support viewing their Python interfaces, providing detailed syntax explanations, functional descriptions, and parameter specifications to facilitate Python development.

  Tools can be created by loading Python files (*.py). When executing Python tools, corresponding Python code will be output in the console area for real-time execution tracking.

  SuperMap iDesktopX custom-developed Python tools can not only run independently but also be added to the canvas to construct automated data processing workflows with other tools. Additionally, tools in GPA support exporting as Python files for code reuse.

Add Python Tool

  The toolbox supports rapid customization through Python language. Users can directly develop functionalities by importing *.py files or entering Python code. Scripts must define input and output parameters (i.e., input and output), where input controls support Directory, String, and Dataset types, while output controls only support Dataset type. The definition format is as follows:

#input,field,type,Description,Default Value   
#output,field,type,Description,Default Value

To create a Custom Python Tool under the Python Tools node in the toolbox, follow these steps:

  1. Right-click the Toolbox -> Python Tools node and select Add Python Tool;
  2. In the dialog box, select an existing local *.py file or directly input Python script in the text area;

  3. Set the tool name in the Tool Name field and click OK. The new tool will appear under the Python Tools node.

    1. Customized tools can be directly executed by double-clicking or added to the GPA modeling window for combined use with other tools.

    2. Custom Python tools support modifications. Select the Modify option from the context menu to optimize code or adjust tool names in the Modify Python Tools dialog.