I have some code that will take a ArcGIS 10.2.2 feature class and post a copy of it in a different geodatabase.
My code is set up so the end user can pick the feature class they want the model to run (getparameterastext). My problem is the code doesn't name the new feature class the same name as the original feature class. My code "hard codes" a name to the new feature class being posted. What do I need to change the my code so the new file will name the new feature class the same name of the original feature class the end user pics? This is what my code looks like.
# Import arcpy module
import arcpy
# Local variables:
maint_FC = arcpy.GetParameterAsText(0)
sdr_staging_gdb = "Y:\\data\\dev\\staging\\sdr_staging.gdb"
staging = "Y:\\data\\dev\\staging"
# Process: Feature Class to Feature Class
arcpy.FeatureClassToFeatureClass_conversion(maint_FC, sdr_staging_gdb, 'maint_FC', "", "POL_DIST \"POL_DIST\" true true false 3 Text 0 0 ,First,#,Database Connections\\UGGSSSQL_GISPUB_basemap.sde\\gispub.BASEMAP.gisdata\\gispub.BASEMAP.TL_TEST_2,POL_DIST,-1,-1;INSPECTOR \"INSPECTOR\" true true false 50 Text 0 0 ,First,#,Database Connections\\UGGSSSQL_GISPUB_basemap.sde\\gispub.BASEMAP.gisdata\\gispub.BASEMAP.TL_TEST_2,INSPECTOR,-1,-1;INSP_NBR \"INSP_NBR\" true true false 3 Text 0 0 ,First,#,Database Connections\\UGGSSSQL_GISPUB_basemap.sde\\gispub.BASEMAP.gisdata\\gispub.BASEMAP.TL_TEST_2,INSP_NBR,-1,-1;COMMENT \"COMMENT\" true true false 50 Text 0 0 ,First,#,Database Connections\\UGGSSSQL_GISPUB_basemap.sde\\gispub.BASEMAP.gisdata\\gispub.BASEMAP.TL_TEST_2,COMMENT,-1,-1;DATE_MOD \"DATE_MOD\" true true false 36 Date 0 0 ,First,#,Database Connections\\UGGSSSQL_GISPUB_basemap.sde\\gispub.BASEMAP.gisdata\\gispub.BASEMAP.TL_TEST_2,DATE_MOD,-1,-1;DATE_ADDED \"DATE_ADDED\" true true false 36 Date 0 0 ,First,#,Database Connections\\UGGSSSQL_GISPUB_basemap.sde\\gispub.BASEMAP.gisdata\\gispub.BASEMAP.TL_TEST_2,DATE_ADDED,-1,-1;MOD_BY \"MOD_BY\" true true false 50 Text 0 0 ,First,#,Database Connections\\UGGSSSQL_GISPUB_basemap.sde\\gispub.BASEMAP.gisdata\\gispub.BASEMAP.TL_TEST_2,MOD_BY,-1,-1;ADDED_BY \"ADDED_BY\" true true false 50 Text 0 0 ,First,#,Database Connections\\UGGSSSQL_GISPUB_basemap.sde\\gispub.BASEMAP.gisdata\\gispub.BASEMAP.TL_TEST_2,ADDED_BY,-1,-1;Shape_STArea__ \"Shape_STArea__\" false false true 0 Double 0 0 ,First,#,Database Connections\\UGGSSSQL_GISPUB_basemap.sde\\gispub.BASEMAP.gisdata\\gispub.BASEMAP.TL_TEST_2,Shape.STArea(),-1,-1;Shape_STLength__ \"Shape_STLength__\" false false true 0 Double 0 0 ,First,#,Database Connections\\UGGSSSQL_GISPUB_basemap.sde\\gispub.BASEMAP.gisdata\\gispub.BASEMAP.TL_TEST_2,Shape.STLength(),-1,-1", "")
# Process: Feature Class To Shapefile (multiple)
arcpy.FeatureClassToShapefile_conversion(maint_FC, staging)