I'm not a programmer just trying to make somthing work for my sar team. Running ArcGIS pro 2.7 working on the script in spyder 4.2.0 the project is open when testing the script. Eventually I want the script to be a tool in a toolbox in arcgis pro so we can just click it and process the updated gpx files as teams return from a search. What I have below creates the featureclass based on the gpx file name.
My problem looks a lot like the another posted recently so sorry if I should have just added to his.
1. How do I add this to the current map? I tried .adddatatomap but I guess I do not understand how to use it
2. Once I get it to the map or even before I don't care I want to apply a symbol that I have created and is in F:\GIS\OBSAR\sartraining1.gdb\Green_GPS_Dashed_Line_Symbol each gpx file will have a symbol created for it based on its name so we can quickly see/tell who has covered what areas
import os
import arcpy
arcpy.env.overwriteOutput = True # allows the script to be ran multiple times without first cleaning up the geodatabase
arcpy.ImportToolbox(r"c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Conversion Tools.tbx")
arcpy.ImportToolbox(r"c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx")
#arcpy.env.workspace = "F:\GIS\OBSAR\sartraining1.gdb"
arcpy.env.workspace = "F:\GIS\OBSAR\GPX\Contacts"
#arcpy.env.workspace = "F:\GIS\OBSAR\OBSAR.aprx"
#fcs = []
fcs = os.listdir( "F:\GIS\OBSAR\GPX\Contacts")
for I in fcs:
FI = "F:\\GIS\\OBSAR\\GPX\\Contacts\\" + I
FO = arcpy.Describe(I).baseName + "_gpxtofeature"
path = "F:\\GIS\\OBSAR\\GPSactions.gdb\\"
LO = arcpy.Describe(I).baseName + "_PointsToLine"
symin = path + arcpy.Describe(I).baseName
#print(FI)
#print(FO)
#print (LO)
#print (symin)
arcpy.conversion.GPXtoFeatures(Input_GPX_File=FI, Output_Feature_class= path + FO)
arcpy.management.PointsToLine(Input_Features = path + FO, Output_Feature_Class = path + LO, Line_Field="", Sort_Field="", Close_Line="NO_CLOSE")