New answers tagged arcpy-mapping
I had the same issue. I simply reversed the order of operations by export to excel first, then adding the layer. Or if that doesn't work you could just re-add the layer, no?
Assuming you are looping through the geometry and panning around via a Search Cursor, you can set a definition query on a layer to show only the Buffer that has the OID equal the the feature you are currently on as you step through the table. Make sure you call arcpy.RefreshActiveView() before exporting to PDF. For example: with arcpy.da.SearchCursor(lyr, ...
If you have some values that are null, that may be causing the issue. Try using the following codeblock in the field calculator: def length(field): return len(field) if field else 0 and CountChr = length(!yourFieldName!)
You need to pass the field name behind the input field parameter before converting the expression variable to a string. Otherwise the field name passed to calculate field will simply be "len (!InputField!) instead of the actual field name for that parameter. Try changing expression = "len(!" + InputField + "!)" to expression = ...
For those that don't know what this option does, see When to use Clip Output to Graphics Extent in ArcMap? There a geonet thread about this missing functionality in arcpy. The workaround offered there is to use masking layer. The masking layer can "white out" the zone outside the area of interest before the export is done. This can be done in the ...
On the code snippet and symptoms presented in the question: import arcpy mxd = arcpy.mapping.MapDocument(r"C:\GIS\KUP\Check.mxd") df = arcpy.mapping.ListDataFrames(mxd, "*") addLayer = arcpy.mapping.Layer(r"C:\GIS\KUP\Ergebnisse.gdb\Potenziale_singlepart_final") arcpy.mapping.AddLayer(df, addLayer, "BOTTOM") it seems to me, like @MichaelMilesStimson ...
Top 50 recent answers are included