Select to view content in your preferred language

Possible to make tool script path relative?

1230
3
Jump to solution
05-24-2013 05:19 AM
Zeke
by
Honored Contributor
Is it possible to make the path to the script for a tool relative rather than absolute? I have users who copy folders with the maps and scripts they need from one network location to another. Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
T__WayneWhitley
Honored Contributor
Yes, on the General panel of the script tool properties, click on 'Store relative path names (instead of absolute paths)'... the only caveat is that you have to make sure the root folder being copied actually contains the script file.  In other words, if copying only part of the contents of the folder and omit to copy the accompanying tool script file, the path will of course be broken.

The only way around that is to create a python toolbox so that the tbx tool interface and source script are bound together...


Enjoy,
Wayne

View solution in original post

0 Kudos
3 Replies
T__WayneWhitley
Honored Contributor
Yes, on the General panel of the script tool properties, click on 'Store relative path names (instead of absolute paths)'... the only caveat is that you have to make sure the root folder being copied actually contains the script file.  In other words, if copying only part of the contents of the folder and omit to copy the accompanying tool script file, the path will of course be broken.

The only way around that is to create a python toolbox so that the tbx tool interface and source script are bound together...


Enjoy,
Wayne
0 Kudos
by Anonymous User
Not applicable
In addition to what Wayne said, you can also [url=http://resources.arcgis.com/en/help/main/10.1/index.html#//005700000017000000]embed[/url] the script so that it stays with the the tool.  This is a good option if you will not need to alter the code.  Another cool thing about this is that you can password protect the code so that only those with access can alter it.
0 Kudos
Zeke
by
Honored Contributor
Thanks both. Guess I never saw the relative path checkbox. We're still on 10.0, so I don't think python toolboxes are available at this point. The users do copy the whole folder, with their map templates, scripts, fgdb, etc. This isn't the most space eficient method, but they step all over each other's projects when they work out of a common shared folder and I get called down to fix it for them.
0 Kudos