Tag Info

New answers tagged

0

You can use the Copy GP tool for copying the entire feature dataset where the ND resides + it will copy all the related ND tables found in the geodatabase (outside of FD). This will preserve the ND and you don't need to create one. You are correct that it is not allowed to run the Dissolve network on an ND stored within the SDE geodatabase, you do need to ...


2

See comments below: import arcpy #Get data frame object mxd = arcpy.mapping.MapDocument(r'C:/test.mxd') df = arcpy.mapping.ListDataFrames(mxd, 'Layers')[0] #Get spatial reference object from data frame SR = df.spatialReference #List all layers in data frame layers = arcpy.mapping.ListLayers (mxd, "", df) #Iterator for naming files i = 0 #Iterate all ...


3

Instead of calling arcpy.mapping.MapDocument.findAndReplaceWorkspacePaths(...), have you tried calling mxd.findAndReplaceWorkspacePaths(...)? Calling the function from the object you created (mxd) ensures that ArcPy knows which map document you are working with, whereas the code you have doesn't specify the map document (your are calling the unbound method, ...


1

First, check your script against a directory with one mxd and one layer, to make sure that the problem isn't something in the part of your script that you didn't post. Next, you need to modify your script to test for more "layer.supports" properties besides "dataSource". I use the version below: for lyr in lyrList: dType = "UNK" ...


2

I ran the test code below using ArcGIS 10.3.1 for Desktop: import arcpy mxd = arcpy.mapping.MapDocument("C:\\temp\\temp.mxd") featurelayer = arcpy.mapping.ListLayers(mxd, "Animals_Insects")[0] attr = 'hhsericiculture' featurelayer.symbology.valueField = attr print "Works for field hhsericiculture" attr = 'pct_ahhwinsect_raising' ...


0

As crmackey posted in a comment: You cannot control the symbology explicitly with arcpy. What you can do is save a Layer File (.lyr) with that symbology and then use arcpy.management.ApplySymbologyFromLayer where you would reference your .lyr file



Top 50 recent answers are included