WebMay 8, 2024 · import time import arcpy, os aprx = arcpy.mp.ArcGISProject ("CURRENT") lyt = aprx.listLayouts ("13 Dual Panel Route Map") [0] m = aprx.listMaps ("ROUTE MAP") [0] ms = lyt.mapSeries df1 = lyt.listElements ("MAPFRAME_ELEMENT","Map Frame 01") [0] #MAKE SURE LAYER NAME MATCHES DATAFRAME df2 = lyt.listElements … WebAug 19, 2024 · 1 Answer Sorted by: 6 It's failing because you're passing in a string to the addLayer function and hoping the method will resolve to the layer you created. In short, it wont. You'll need to be more explicit in what you pass addLayer - …
ArcPY常用函数和属性(ArcGISPro版)_qq_45373844的博 …
WebAug 18, 2024 · AOI = arcpy.GetParameterAsText (0) Well what if that input the user selected the layer from within the map, that's a layer not a feature class. Also another potential problem is where the layer you load using addDataFromPath () is inserted into your table of contents. Looking at the help file it says that placement is based upon a set of rules. WebJul 15, 2024 · So far I've been messing with arcpy.SearchCursor, to iterate the selection of the features. Inside the cursor, I need to use mf.camera.setExtent (mf.getLayerExtent … explosive ship
python 3.x - Creating layout PDFs by iterating feature selection …
WebFeb 9, 2024 · lyr = arcpy.mapping.ListLayers (mxd, '', df) [2] print lyr.name extent = lyr.getExtent () print extent df.extent = extent Share Improve this answer Follow answered Feb 9, 2024 at 2:52 Midavalo ♦ 29.4k 9 45 101 Add a comment 1 UPDATE for arcpy in Arcgis Pro: mapping sub module is no longer available. Use mp sub module instead. WebJan 7, 2016 · import arcpy, os # Create a script tool roadFeatures = arcpy.GetParameterAsText (0) field = arcpy.GetParameterAsText (0) #in the tool setup, use the "obtain from" setting and set it to the road features #Or, just assign your data, as you did previously # #roadFeatures = "Test_Roads" #field = "FacilityID" ## I use these 3 … WebJul 7, 2024 · aprx = arcpy.mp.ArcGISProject("CURRENT") mv = aprx.activeView # mapview m = mv.map # map mv.camera.setExtent(mv.getLayerExtent(m.listLayers('USA_Counties_Generalized')[0])) This works because "getLayerExtent" honors any active selection. View solution in … bubble power book