Creating a feature class within a feature dataset crashes ArcCatalog

476
2
Jump to solution
05-04-2012 06:27 AM
MatthewWalker1
New Contributor III
I am trying to copy an existing feature class that is within a feature dataset and paste in a new feature class (this same schema, but a linear feature instead of a point feature-i.e. using the existing point feature class as a template for the new linear feature class) into that same feature dataset, using this code:

import arcpy from arcpy import env env.workspace = r"database connections\connection to BASE.sde"  #Use existing Feature class (point) feature (<Featureclass_Name>) as template to create new linear Feature class arcpy.CreateFeatureclass_management("database connections/connection to KMC-BASE.sde", "BASE.BASE.KMC.Exposures_Platte_Line",  "POLYLINE", "BASE.BASE.Exposures_Platte", "ENABLED", "ENABLED")

and ArcCatalog crashes after about a minute of thinking, no error thrown. Any ideas on this issue?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MatthewWalker1
New Contributor III
Just seeing if I can refresh this post, and see if anyone out there knows why ArcCatalog crashes with my code.  I'm basically trying to use Python script to create a linear feature within an existing feature dataset, and using an existing feature class as a template.


Solution!:
I needed to resolve the spaces that were in the connection paths by placing an 'r' (MUST be lower case!) in front of each path.  This code worked (I made a variable, 'Path', for the above path name to make deployment of this code more efficient):

arcpy.CreateFeatureclass_management(Path, r"Exposures_Platte_Line_Test2", "POLYLINE", Path +"\BASE.BASE.Exposures_Platte")  

View solution in original post

0 Kudos
2 Replies
MatthewWalker1
New Contributor III
I am trying to copy an existing feature class that is within a feature dataset and paste in a new feature class (this same schema, but a linear feature instead of a point feature-i.e. using the existing point feature class as a template for the new linear feature class) into that same feature dataset, using this code:

import arcpy
from arcpy import env
env.workspace = r"database connections\connection to BASE.sde"

#Use existing Feature class (point) feature (<Featureclass_Name>) as template to create new linear Feature class
arcpy.CreateFeatureclass_management("database connections/connection to KMC-BASE.sde", "BASE.BASE.KMC.Exposures_Platte_Line", 
"POLYLINE", "BASE.BASE.Exposures_Platte", "ENABLED", "ENABLED")

and ArcCatalog crashes after about a minute of thinking, no error thrown. Any ideas on this issue?


Just seeing if I can refresh this post, and see if anyone out there knows why ArcCatalog crashes with my code.  I'm basically trying to use Python script to create a linear feature within an existing feature dataset, and using an existing feature class as a template.
0 Kudos
MatthewWalker1
New Contributor III
Just seeing if I can refresh this post, and see if anyone out there knows why ArcCatalog crashes with my code.  I'm basically trying to use Python script to create a linear feature within an existing feature dataset, and using an existing feature class as a template.


Solution!:
I needed to resolve the spaces that were in the connection paths by placing an 'r' (MUST be lower case!) in front of each path.  This code worked (I made a variable, 'Path', for the above path name to make deployment of this code more efficient):

arcpy.CreateFeatureclass_management(Path, r"Exposures_Platte_Line_Test2", "POLYLINE", Path +"\BASE.BASE.Exposures_Platte")  
0 Kudos