<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python script read coordinate system, drag and drop in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26428#M1979</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Chris, I'm running ArcGIS 10.0 without any service pack.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been retrying this a number of times, and it crashes pretty reliably, but not every single time.&amp;nbsp; One time gave me the error message you mentioned after I correctly input a layer and then tried to drag one from an inactive dataframe, but now that doesn't work and it crashes everytime...&amp;nbsp; I'm using a script that I created, and it's one of my first attempts at any meaningful programming, so I could have something wrong that I'm unaware of.&amp;nbsp; I can give you more details on the script if you need.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Dec 2012 21:08:46 GMT</pubDate>
    <dc:creator>AdamCox1</dc:creator>
    <dc:date>2012-12-21T21:08:46Z</dc:date>
    <item>
      <title>Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26417#M1968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a python script that accepts a project shapefile, asks for a few parameters, and does the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Projects to a new coordinate system (as defined by the user)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Calculates new X and Y values&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Saves as a layer file&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Saves as a KMZ file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script, fortunately, works as intended, but I'm trying to make it run nicer and be more user-friendly. I want to do the following things:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. When the original shapefile is loaded, I would like the tool to read it's coordinate system and enter that information in a box in the tool (similar to what happens in the "Project" tool when a shapefile is added). It would just be there for reference and would not be editable. I understand this may need to be done through the Tool Validator class, but I do not have much experience with this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. The tool does not currently allow me to drag-and-drop a shapefile into the tools input from the TOC. How do I enable this functionality?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code I have so far, for reference:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Author: Zachary Bartlett
# Date: June 14, 2012
# 1. Input .shp
# 2. Read coordinate system
# 3. Input: New coordinate system
# 4. Project: to new MTM coordinate system
# 5. Output: new shapefile projected to MTM
# 5. Input: New X and Y field names
# 6. Add X and Y coordinates
# 7. Output: .lyr with custom name
# 8. Output: .kmz with custom name

import arcpy, os, glob

# INPUT SHAPEFILE

input_shp = arcpy.GetParameterAsText(0)
arcpy.AddMessage("Input shapefile: " + str(input_shp))

work_folder_pos = input_shp.rfind("\\")
work_folder = input_shp[0:int(work_folder_pos)]
arcpy.AddMessage("Workspace: " + str(work_folder))

# READ COORDINATE SYSTEM

coordinatesystem_ORIG = arcpy.Describe(input_shp).spatialReference
arcpy.AddMessage("Input Coordinate System: " + str(coordinatesystem_ORIG.name))

# PROJECT input_shp TO NEW COORDINATE SYSTEM AND SAVE AS NEW SHP

MTM_shp = arcpy.GetParameterAsText(1)
coordinatesystem_NEW = arcpy.GetParameterAsText(2)
arcpy.AddMessage("Output shapefile: " + str(MTM_shp))
arcpy.AddMessage("Output Coordinate System: " + str(coordinatesystem_NEW))
arcpy.Project_management(input_shp, MTM_shp, coordinatesystem_NEW) 

# ADD X AND Y COORDINATES TO MTM_shp AS POINT_X AND POINT_Y

arcpy.AddXY_management(MTM_shp)
#arcpy.AddMessage("Input shapefile coordinate system: ") + coordinatesystem_ORIG

# INPUT X AND Y FIELD NAMES

X_MTM_fieldname = arcpy.GetParameterAsText(3)
Y_MTM_fieldname = arcpy.GetParameterAsText(4)
arcpy.AddField_management(MTM_shp, X_MTM_fieldname, "double", "15", "3", "", "", "NON_NULLABLE", "REQUIRED")
arcpy.AddField_management(MTM_shp, Y_MTM_fieldname, "double", "15", "3", "", "", "NON_NULLABLE", "REQUIRED")

# COPY POINT_X AND POINT_Y to X_MTM_fieldname and Y_MTM_fieldname

arcpy.CalculateField_management(MTM_shp, X_MTM_fieldname, '!POINT_X!', "PYTHON")
arcpy.CalculateField_management(MTM_shp, Y_MTM_fieldname, '!POINT_Y!', "PYTHON")

#DELETE POINT_X AND POINT_Y COLUMNS

arcpy.DeleteField_management(MTM_shp, ["POINT_X", "POINT_Y"])

# CREATE TEMPORARY FEATURE LAYER

fl_temp = work_folder + "\MTM_lf_temp"
arcpy.MakeFeatureLayer_management(MTM_shp, fl_temp)

#OUTPUT LYR WITH CUSTOM NAME

output_lyr = arcpy.GetParameterAsText(5)
#output_lyr = arcpy.AddMessage("Output Layer File: ")
arcpy.SaveToLayerFile_management(fl_temp, output_lyr)

# OUTPUT DBF WITH CUSTOM NAME

##output_dbf = arcpy.GetParameterAsText(6)
##arcpy.TableToDBASE_conversion(MTM_shp, output_dbf)

#OUTPUT KMZ WITH CUTOM NAME

output_kmz = arcpy.GetParameterAsText(6)
#output_kmz = arcpy.AddMessage("Output KMZ File: ")
arcpy.LayerToKML_conversion(output_lyr, output_kmz, 10000)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Zack&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 19:02:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26417#M1968</guid>
      <dc:creator>ZackBartlett</dc:creator>
      <dc:date>2012-06-18T19:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26418#M1969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Zack,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.&amp;nbsp; You will need to update the updateParameters function within the ToolValidator class with the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def updateParameters(self):
&amp;nbsp; if self.params[0].value:
&amp;nbsp;&amp;nbsp;&amp;nbsp; sr = arcpy.Describe(self.params[0].value).spatialReference
&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[7].value = sr.name
&amp;nbsp; self.params[7].enabled = 0
&amp;nbsp; return&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The index value for self.params[7] may be different depending on where you want the input coordinate system to be shown within the tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2.&amp;nbsp; Change the parameter's Data Type to 'Feature Layer'.&amp;nbsp; This will allow you to drag and drop, and also provide a dropdown listing the feature classes within ArcMap.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:04:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26418#M1969</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-10T21:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26419#M1970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What sort of modifications do I need to make to my script code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Zack&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2012 17:17:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26419#M1970</guid>
      <dc:creator>ZackBartlett</dc:creator>
      <dc:date>2012-06-19T17:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26420#M1971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You won't have to make any to your python script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2012 17:23:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26420#M1971</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-06-19T17:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26421#M1972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When I add your text to the tool validator, my "Output .shp" (GetParameterAsText[1]) field is greyed out. And the "Output .kmz" (GetParameterAsText[6]) is now missing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried adding another Parameter to house the Coordinate System, but the field doesn't populate when I add a shapefile, and I get the following error my "Input .shp" (GetParameterAsText[0]):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;updateParameters Execution Error: Runtime error : ParameterObject: Invalid input value for Value property&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2012 17:46:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26421#M1972</guid>
      <dc:creator>ZackBartlett</dc:creator>
      <dc:date>2012-06-19T17:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26422#M1973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you send a screen shot of your Properties tab within the script properties?&amp;nbsp; Depending on where you have the parameter set up for the coordinate system you will have to change index values for the 'arcpy.GetParameterAsText' function, and the self.params within the ToolValidator.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 10:09:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26422#M1973</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-06-20T10:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26423#M1974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's a screenshot of the Parameters tab:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]15389[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 12:12:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26423#M1974</guid>
      <dc:creator>ZackBartlett</dc:creator>
      <dc:date>2012-06-21T12:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26424#M1975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Zack,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks like you set the Input Coordinate system as the second parameter, so this will have an index of 1.&amp;nbsp; Therefore, you will need to increase all of your index values for arcpy.GetParameterAsText (excluding arcpy.GetParameterAsText(0)) by 1 within your code.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The ToolValidator should appear as below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def updateParameters(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[0].value:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sr = arcpy.Describe(self.params[0].value).spatialReference
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].value = sr.name
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[1].enabled = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:04:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26424#M1975</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-10T21:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26425#M1976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Also, I noticed in your original code, you have the output dbf and kmz file as the same index for the arcpy.GetParameterAsText:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# OUTPUT DBF WITH CUSTOM NAME&amp;nbsp; ##output_dbf = arcpy.GetParameterAsText(6) ##arcpy.TableToDBASE_conversion(MTM_shp, output_dbf)&amp;nbsp; #OUTPUT KMZ WITH CUTOM NAME&amp;nbsp; output_kmz = arcpy.GetParameterAsText(6) #output_kmz = arcpy.AddMessage("Output KMZ File: ") arcpy.LayerToKML_conversion(output_lyr, output_kmz, 10000)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Change the OUTPUT KMZ to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;output_kmz = arcpy.GetParameterAsText(7)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:04:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26425#M1976</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-10T21:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26426#M1977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, this thread was hugely helpful to me, as I was trying to do the exact same things as Zack.&amp;nbsp; I was having the same problem after following this advice and found that the issue was that I still had the spatial reference parameter input type set to Spatial Reference, when I needed to have it set to String because that's what I was trying to put into it...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I have a question about the other suggestion for dragging and dropping.&amp;nbsp; Changing the parameter input type to "Feature Layer" does allow me to drag and drop from the TOC, which is great, but if I try to drag and drop from an INACTIVE dataframe, ArcMap encounters a serious error and crashes.&amp;nbsp; Is this a known problem?&amp;nbsp; Am I missing a piece of the puzzle?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Adam&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 12:53:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26426#M1977</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2012-12-20T12:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26427#M1978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Adam, which version and sp are you at? I can't reproduce the crash at 10.1 sp1, but I will say drag/drop or referencing a layer from an inactive data frame has never been supported. You can see this if you click the drop-down in the parameter it will only show you the layers from the active data frame. You should get an error on the parameter saying the input dataset doesn't exist. However, it still shouldn't crash and if we can reproduce it I would like to log a bug.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 22:41:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26427#M1978</guid>
      <dc:creator>ChrisFox3</dc:creator>
      <dc:date>2012-12-20T22:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26428#M1979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Chris, I'm running ArcGIS 10.0 without any service pack.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been retrying this a number of times, and it crashes pretty reliably, but not every single time.&amp;nbsp; One time gave me the error message you mentioned after I correctly input a layer and then tried to drag one from an inactive dataframe, but now that doesn't work and it crashes everytime...&amp;nbsp; I'm using a script that I created, and it's one of my first attempts at any meaningful programming, so I could have something wrong that I'm unaware of.&amp;nbsp; I can give you more details on the script if you need.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2012 21:08:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26428#M1979</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2012-12-21T21:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26429#M1980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To narrow it down, could you try drag/drop into a system tool like copy features? Does it still crash. This would tell us if it is specific to your tool or not.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2012 21:20:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26429#M1980</guid>
      <dc:creator>ChrisFox3</dc:creator>
      <dc:date>2012-12-21T21:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26430#M1981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, I tried that right away and it doesn't crash, I just get the "does not exist/not supported" message.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok, it only happens when I drag/drop into the parameter that has been modified in the ToolValidator with the code described above.&amp;nbsp; Here is the code that I have in ToolValidator:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; ([1] is the input fc parameter set to feature layer, and [2] is the string parameter that just shows the coordinate system of [1]):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def updateParameters(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].enabled = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.params[1].value:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].enabled = 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SR = arcpy.Describe(self.params[1].value).spatialReference
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].value = SR.name
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.params[2].enabled = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I comment out this code, the parameter drag/drop operation functions as it should.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:04:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26430#M1981</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2021-12-10T21:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26431#M1982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Adam,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you send a screen shot of your Parameters tab within the Script properties?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Dec 2012 10:43:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26431#M1982</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-12-26T10:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26432#M1983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jake, Happy New Year!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a screen shot.&amp;nbsp; Let me know if you wanted a different parameter highlighted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Adam&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 13:38:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26432#M1983</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2013-01-02T13:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26433#M1984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try upgrading to &lt;/SPAN&gt;&lt;A href="http://support.esri.com/en/downloads/patches-servicepacks/view/productid/160/metaid/1876"&gt;Service Pack 5&lt;/A&gt;&lt;SPAN&gt; and see if you are still able to reproduce the crash.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 14:48:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26433#M1984</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-01-02T14:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python script read coordinate system, drag and drop</title>
      <link>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26434#M1985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Service Pack 5 seems to have done the trick, no crashing, just the expected error message.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 15:06:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-read-coordinate-system-drag-and-drop/m-p/26434#M1985</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2013-01-02T15:06:30Z</dc:date>
    </item>
  </channel>
</rss>

