Hi all!
I am using the following code to create a new FGDB and a new Feature Class, but none of them are shown in the Catalog pane after creation.
# Create a dedicated FGDB
gdb = "ReplayedRecs.gdb"
arcpy.CreateFileGDB_management(arcpy.env.workspace, gdb)
# Temp FCs that will be deleted
PointsFC = arcpy.env.workspace + "\\" + gdb + "\\" + "RecordingPoints"
LinesFC = arcpy.env.workspace + "\\" + gdb + "\\" + "RecordingPaths"
# Creates a FC that stores the replayed recordings
ReplayedPaths = arcpy.CreateFeatureclass_management(gdb, "ReplayedPaths", "POLYLINE", spatial_reference=spatial_reference)
# Read each csv file, create point features, and then polylines
for csv in csv_files:
csv_path = PATH_TO_CSVS + "\\" + csv
# Convert CSV Rows to Point Features
arcpy.management.XYTableToPoint(in_table=csv_path,
out_feature_class=PointsFC,
x_field="x",
y_field="y")
# Execute PointsToLine
arcpy.PointsToLine_management(Input_Features=PointsFC,
Output_Feature_Class=LinesFC)
arcpy.Append_management(LinesFC, ReplayedPaths)
# Delete PointsFC and LinesFC
arcpy.Delete_management(PointsFC)
arcpy.Delete_management(LinesFC)