Can we no longer reference an ArcMap layer to get the spatial reference?

المشرف العام

Administrator
طاقم الإدارة
I'm currently using ArcGIS 10.2.1. In previous custom geoprocessing tools, I've used the following code to create a feature class in-memory, and set the spatial reference using an existing layer in ArcMap:

polygon = arcpy.GetParameterAsText(0)mem_point = arcpy.CreateFeatureclass_management("in_memory", "mem_point", "POINT", "", "DISABLED", "DISABLED", polygon)Where polygon is a layer in the ArcMap TOC. This has always worked in the past, but I just went to use one of the tools, and I got the following error:

Traceback (most recent call last): File "", line 23, in mem_point = arcpy.CreateFeatureclass_management("in_memory", mem_name, "POINT", "", "DISABLED", "DISABLED", polygon) File "",line 1800, in CreateFeatureclass raise e ExecuteError: ERROR 000622: Failed to execute (Create Feature Class). Parameters are not valid. ERROR 000628: Cannot setinput into parameter spatial_reference.Did this just recently change?



أكثر...
 
أعلى