POST
|
Joshua, thank you so much. This is exactly what I needed. The .addDataFromPath method is a lifesaver.
... View more
08-16-2017
06:35 AM
|
1
|
0
|
4241
|
POST
|
Hi Johannes, Thanks for the link! It is helpful, but it does not address how to perform the operation with the arcpy.mp module. I have used the arcpy.mapping module in the past, but now I am on ArcGIS Pro. It seems like some of the changes from mapping ---> mp have made certain operations very difficult! It is mind-boggling to me that it should be so hard to add a shapefile from disk to the TOC.
... View more
08-16-2017
06:05 AM
|
0
|
1
|
4241
|
POST
|
I am writing a script tool to be used in ArcGIS Pro. The script tool performs some geoprocessing and saves its results to a folder. What I would like to do is add the results from disk back to the current map document. Basically, I am looking for the equivalent to the below for arcpy.mp in Python 3: import arcpyfrom arcpy import env # get the map documentmxd = arcpy.mapping.MapDocument("CURRENT")# get the data framedf = arcpy.mapping.ListDataFrames(mxd,"*")[0]# create a new layernewlayer = arcpy.mapping.Layer(path_to_shapefile_or_feature_class)# add the layer to the map at the bottom of the TOC in data frame 0arcpy.mapping.AddLayer(df, newlayer,"BOTTOM") I need to add a shapefile, not a .lyrx file. Is there a way to do this with arcpy.mp? I have been looking everywhere.
... View more
08-15-2017
01:12 PM
|
0
|
6
|
6856
|
Title | Kudos | Posted |
---|---|---|
1 | 08-16-2017 06:35 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|