sdna_open icon indicating copy to clipboard operation
sdna_open copied to clipboard

Invalid alias in ArcGIS Python Toolbox

Open lpinner opened this issue 1 year ago • 0 comments

The sDNA ArcGIS python toolbox alias is invalid:

self.alias = "Spatial Design Network Analysis"

From the ArcGIS documentation:

toolbox alias must begin with a letter (a-z, A-Z) and can only consist of letters and numbers (0-9). Spaces and special characters are not allowed (for example, _, !, @, #, $, %, -).

So when users try to use the toolbox from within a script with arcpy.ImportToolbox, python will raise a SyntaxError if they try to use the invalid alias). The workaround is to use the arcpy.ImportToolbox module_name parameter to set a valid temporary alias.

Suggest you change the alias to:

self.alias = "sDNA"

lpinner avatar Apr 16 '23 00:04 lpinner