AnsweredAssumed Answered

Script tool feature set problem in ArcGIS 10.1

Question asked by englandgirl22 on Dec 14, 2012
Latest reply on Dec 17, 2012 by englandgirl22
[ATTACH=CONFIG]19937[/ATTACH]Hi there,
We are upgrading from 10 to 10.1 at the moment and I have a script tool in a toolbox that allows the user to click on the map, fill in some details and create a map based on the settings held in the mxd.  This involves using a feature set, with the schema being specified in the parameters of the script tool and works fine in ArcGIS 10. 

I have since tried to run it in 10.1 and it would appear as though my schema is not being recognised and the screen looks like the attached so no attribute data can be recorded.

My script that worked in 10 is below and I cannot see what I would need to change to get it to work in 10.1. 

Any help would be greatly appreciated!


# AUTOMATING LIVEBOARD MAPS FOR COURT  # Author: M.Convey - 20.01.2012     # Versions: ArcGIS 10.  Python 2.6      # Python script to allow the automatic production of a liveaboard map for the Enforcement team # The user clicks on the script / button and then clicks on the map at the point at which their boat is # The user then completes the attributes presented to them: Boat name, index number, canal, nearest town # After the user has then selected where to save the PDF, clicking GO will begin the script # Changes should not be saved   # Import arcpy module import arcpy  # Load required toolboxes arcpy.ImportToolbox("G:/GIS_Admin/zNamed_folders/Michelle/Projects/Enforcement/Enforcement_10.tbx")  # Workspace arcpy.env.Workspace = r"G:\_Directorate\Marketing\Enforcement\Liveaboard Maps\Liveaboard_Arc10.mdb" wsp = arcpy.env.Workspace  # Overwrite Output arcpy.env.overwriteOutput = True  # Sets the mxd to the one currently in use mapDoc = arcpy.mapping.MapDocument("CURRENT")  # Parameters LiveaboardBoats = r"G:\_Directorate\Marketing\Enforcement\Liveaboard Maps\Liveaboard_Arc10.mdb\LiveaboardBoats" LiveaboardBoatsCopy = r"G:\_Directorate\Marketing\Enforcement\Liveaboard Maps\Liveaboard_Arc10.mdb\LiveaboardBoatsCopy" lyr = r"G:\_Directorate\Marketing\Enforcement\Liveaboard Maps\Boat Location.lyr"  # Append the new liveboard to the 'master' copy of the boats so that have a record arcpy.Append_management(LiveaboardBoatsCopy, LiveaboardBoats)  # Script arguments # This worked fine in 10: Feature_Set = arcpy.GetParameterAsText(0) if Feature_Set == '#' or not Feature_Set:     Feature_Set = "in_memory\\{475E88CB-9AAC-48ED-B772-D04A526AD1F6}" # provide a default value if unspecified   # Get pdf file path to create outputPDFPath = arcpy.GetParameterAsText(1) if outputPDFPath == '#' or not outputPDFPath:     arcpy.AddError("Cannot proceed without specifying an output path for the pdf file")     #return      # Copy the feature set to the temporary holding feature class arcpy.CopyFeatures_management (Feature_Set, LiveaboardBoatsCopy)  # Fix broken data sources that arise when copy (?) for lyr in arcpy.mapping.ListBrokenDataSources(mapDoc):     if lyr.supports("DATASOURCE"):         if lyr.dataSource == r"G:\_Directorate\Marketing\Enforcement\Liveaboard Maps\Liveaboard_Arc10.mdb\LiveaboardBoatsCopy":             lyr.replaceDataSource(r"G:\_Directorate\Marketing\Enforcement\Liveaboard Maps\Liveaboard_Arc10.mdb", "ACCESS_WORKSPACE", "LiveaboardBoatsCopy")    = "LiveaboardBoatsCopy"  # Do other mapp based stuff here...  # Refresh active view arcpy.RefreshActiveView()  # Export arcpy.AddMessage("  Saving as PDF") arcpy.mapping.ExportToPDF(mapDoc,outputPDFPath)  del mapDoc