Map View doesn't update

469
3
07-08-2021 01:16 AM
pkaniouras
New Contributor III

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)

 

Tags (1)
0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

right-click on the gdb and select "refresh"... it should show up

if you want them to show in the map, then you have to make layers out of them and have Pro set to add geoprocessing results to the map (project, options, geoprocessing)


... sort of retired...
0 Kudos
pkaniouras
New Contributor III

Hi and thanks for your answer. 

Refresh doesn't work. The only way to add the gdb is to right-click on Databases --> Add Database


0 Kudos
DanPatterson
MVP Esteemed Contributor

makes sense now.  if the gdb isn't part of the project already, then you will have to use makefeaturelayer specifying the full path to the gdb that you created plus the featureclass name (same would apply for tables if you wanted to make a tableview)


... sort of retired...
0 Kudos