i´ve built in a tool for arccatalog which transfers GIS Files into shape Files. Everything is working so far, but i want it a bit more customer friendly.
Atm it looks like this:
You can right click on the file (here MapInfo .tab file) in the catalog tree and choose in the context menu "Konvertierung in WGS 1984"
then the tool interface opens and you can choose your input and output file:
But its annoying to choose all the time the input in the file system again. I want that my selected file from the catalog tree is already listed as input data.
So my question is:
Is there any way to set the workspace from the input data in my tool TO the selected file on which i right clicked (here: Blk1403.Tab), i.e. the Filepath which is listed on the top in arccatalog.
The Tool is just a simple Model built with ModelBuilder, it contains some Py scripts and some tools from the Toolbox. Then the Model is implemented as a Button with the Add-in Wizard. Then it is draged & dropped into the context menu of the "Text-contextmenu" via Customize Mode.
The first py script of the Model calls the ogr2ogr.exe and looks so far right now:
# -*- coding: iso-8859-15 -*- import sys import string import os import arcgisscripting import arcpy gp = arcgisscripting.create() inPath1 = sys.argv outformat = sys.argv outPath1 = sys.argv ogrstring = ' -f "' + outformat + '" "' + outPath1 + '" "' + inPath1 + '""' callstring = '"C:\\WINDOWS\\system32\\cmd.exe /C" "R:\\RBS\\Software\\FWTools2.4.7\\bin\\ogr2ogr.exe" ' + ogrstring gp.addmessage(callstring) os.system(callstring)