Arcpy - Apply symbology to Feature and add to data frame Planned maintenance scheduled April...

Is it OK if I do not take the receipt in Germany?

Trying to enter the Fox's den

Why doesn't the university give past final exams' answers?

Is there a verb for listening stealthily?

Does traveling In The United States require a passport or can I use my green card if not a US citizen?

Putting Ant-Man on house arrest

false 'Security alert' from Google - every login generates mails from 'no-reply@accounts.google.com'

2 sample t test for sample sizes - 30,000 and 150,000

Would I be safe to drive a 23 year old truck for 7 hours / 450 miles?

"Destructive force" carried by a B-52?

Does the Pact of the Blade warlock feature allow me to customize the properties of the pact weapon I create?

Like totally amazing interchangeable sister outfit accessory swapping or whatever

What could prevent concentrated local exploration?

Assertions In A Mock Callout Test

Can the van der Waals coefficients be negative in the van der Waals equation for real gases?

Converting a text document with special format to Pandas DataFrame

Is my guitar’s action too high?

A German immigrant ancestor has a "Registration Affidavit of Alien Enemy" on file. What does that mean exactly?

Protagonist's race is hidden - should I reveal it?

xkeyval -- read keys from file

Magento 2 Editing phtml files in Production Mode

Recursive calls to a function - why is the address of the parameter passed to it lowering with each call?

When does Bran Stark remember Jamie pushing him?

Marquee sign letters



Arcpy - Apply symbology to Feature and add to data frame



Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Automating importing of symbology into feature classes in ArcMap?Selecting features through ArcPy gives Assertion Error?Using Unique Values Symbology in ArcPy?Change ArcSDE data source for mxds in specific folder using ArcPy?Changing symbology for layer using ArcPy?Getting index of active data frame in ArcPy?Using ArcGIS Desktop to zoom to next selected feature?Setting ArcMap data frame extent with ArcPy?Error when applying symbology layer to output rasterApply symbology to layer using arcpy - emulating the “import symbology function”





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















I need to create a shapefile from a csv, apply symbology from a saved layer, and export the result into an PNG.



My code works up through the shapefile creation part, but it is not applying the symbology and not adding the layer to the active mxd so that I can export into an PNG.



Similar code works within the python window (see second code block) but does not as a standalone script in a custom toolbox.



Any thoughts on how to apply the symbology and add to current data frame?



Standalone Script that does not work:



import os
import arcpy
from arcpy import env

path = 'O:\xyz\abc\Development\'
inDir = path + 'data\'

try:

#set variables
arcpy.env.overwriteOutput = True
arcpy.env.workspace = path
in_Table = "weekly.csv"
x_coords = "X_LON"
y_coords = "Y_LAT"
out_Layer = "test_points"
saved_Layer = "data_template.lyr"
mxd = "template.mxd"
spRef = "WGS_1984.prj"

#delete old layer so new layer can be called same
arcpy.Delete_management(out_Layer + ".shp")

#create feature class from csv
arcpy.MakeXYEventLayer_management(in_Table, x_coords, y_coords,
out_Layer, spRef)

#convert feature class to shapefile
arcpy.FeatureClassToShapefile_conversion(out_Layer, path)

#apply symbology to shapefile
arcpy.ApplySymbologyFromLayer_management(out_Layer, saved_Layer)

#get the data frame
df = mxd.activeDataFrame

#add the layer to the map at the top
arcpy.mapping.AddLayer(df, out_Layer, "TOP")

except Exception:
print(arcpy.GetMessages())


Python Window code that works as expected:



>>> import arcpy
... arcpy.env.overwriteOutput = True
... arcpy.env.workspace = "O:xyzabcDevelopmentdata"
... arcpy.MakeXYEventLayer_management("weekly.csv", "X_LON", "Y_LAT",
"test_points", "O:xyzabcDevelopmentWGS_1984.prj")
... arcpy.ApplySymbologyFromLayer_management("test_points",
"O:xyzabcDevelopmentdatadata_template.lyr")
... mxd = arcpy.mapping.MapDocument("CURRENT")
... for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
... if elm.text == "Old Map Title":
... elm.text = "New Map Title"
... mxd = arcpy.mapping.MapDocument("CURRENT")
... out_png = (r"O:xyzabcDevelopmentexportsweekly.png")
... arcpy.mapping.ExportToPNG(mxd, out_png)
... del mxd




I was able to add the output of the xy event to the dataframe, but I still cant get any symbology.



I need to import symbology from another layer file using the value field. But I am getting an error



symbologyFields = ["VALUE_FIELD", "PCP_WKLY", "PCP_WKLY"] 
arcpy.ApplySymbologyFromLayer_management(temp_Shape,
"O:\XYZ\ABC\Development\data_template.lyr", symbologyFields)
ApplySymbologyFromLayer() takes at most 2 arguments (3 given)









share|improve this question

























  • Try adding the layer first then apply the symbology

    – Keagan Allan
    Jan 11 '18 at 17:26


















1















I need to create a shapefile from a csv, apply symbology from a saved layer, and export the result into an PNG.



My code works up through the shapefile creation part, but it is not applying the symbology and not adding the layer to the active mxd so that I can export into an PNG.



Similar code works within the python window (see second code block) but does not as a standalone script in a custom toolbox.



Any thoughts on how to apply the symbology and add to current data frame?



Standalone Script that does not work:



import os
import arcpy
from arcpy import env

path = 'O:\xyz\abc\Development\'
inDir = path + 'data\'

try:

#set variables
arcpy.env.overwriteOutput = True
arcpy.env.workspace = path
in_Table = "weekly.csv"
x_coords = "X_LON"
y_coords = "Y_LAT"
out_Layer = "test_points"
saved_Layer = "data_template.lyr"
mxd = "template.mxd"
spRef = "WGS_1984.prj"

#delete old layer so new layer can be called same
arcpy.Delete_management(out_Layer + ".shp")

#create feature class from csv
arcpy.MakeXYEventLayer_management(in_Table, x_coords, y_coords,
out_Layer, spRef)

#convert feature class to shapefile
arcpy.FeatureClassToShapefile_conversion(out_Layer, path)

#apply symbology to shapefile
arcpy.ApplySymbologyFromLayer_management(out_Layer, saved_Layer)

#get the data frame
df = mxd.activeDataFrame

#add the layer to the map at the top
arcpy.mapping.AddLayer(df, out_Layer, "TOP")

except Exception:
print(arcpy.GetMessages())


Python Window code that works as expected:



>>> import arcpy
... arcpy.env.overwriteOutput = True
... arcpy.env.workspace = "O:xyzabcDevelopmentdata"
... arcpy.MakeXYEventLayer_management("weekly.csv", "X_LON", "Y_LAT",
"test_points", "O:xyzabcDevelopmentWGS_1984.prj")
... arcpy.ApplySymbologyFromLayer_management("test_points",
"O:xyzabcDevelopmentdatadata_template.lyr")
... mxd = arcpy.mapping.MapDocument("CURRENT")
... for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
... if elm.text == "Old Map Title":
... elm.text = "New Map Title"
... mxd = arcpy.mapping.MapDocument("CURRENT")
... out_png = (r"O:xyzabcDevelopmentexportsweekly.png")
... arcpy.mapping.ExportToPNG(mxd, out_png)
... del mxd




I was able to add the output of the xy event to the dataframe, but I still cant get any symbology.



I need to import symbology from another layer file using the value field. But I am getting an error



symbologyFields = ["VALUE_FIELD", "PCP_WKLY", "PCP_WKLY"] 
arcpy.ApplySymbologyFromLayer_management(temp_Shape,
"O:\XYZ\ABC\Development\data_template.lyr", symbologyFields)
ApplySymbologyFromLayer() takes at most 2 arguments (3 given)









share|improve this question

























  • Try adding the layer first then apply the symbology

    – Keagan Allan
    Jan 11 '18 at 17:26














1












1








1








I need to create a shapefile from a csv, apply symbology from a saved layer, and export the result into an PNG.



My code works up through the shapefile creation part, but it is not applying the symbology and not adding the layer to the active mxd so that I can export into an PNG.



Similar code works within the python window (see second code block) but does not as a standalone script in a custom toolbox.



Any thoughts on how to apply the symbology and add to current data frame?



Standalone Script that does not work:



import os
import arcpy
from arcpy import env

path = 'O:\xyz\abc\Development\'
inDir = path + 'data\'

try:

#set variables
arcpy.env.overwriteOutput = True
arcpy.env.workspace = path
in_Table = "weekly.csv"
x_coords = "X_LON"
y_coords = "Y_LAT"
out_Layer = "test_points"
saved_Layer = "data_template.lyr"
mxd = "template.mxd"
spRef = "WGS_1984.prj"

#delete old layer so new layer can be called same
arcpy.Delete_management(out_Layer + ".shp")

#create feature class from csv
arcpy.MakeXYEventLayer_management(in_Table, x_coords, y_coords,
out_Layer, spRef)

#convert feature class to shapefile
arcpy.FeatureClassToShapefile_conversion(out_Layer, path)

#apply symbology to shapefile
arcpy.ApplySymbologyFromLayer_management(out_Layer, saved_Layer)

#get the data frame
df = mxd.activeDataFrame

#add the layer to the map at the top
arcpy.mapping.AddLayer(df, out_Layer, "TOP")

except Exception:
print(arcpy.GetMessages())


Python Window code that works as expected:



>>> import arcpy
... arcpy.env.overwriteOutput = True
... arcpy.env.workspace = "O:xyzabcDevelopmentdata"
... arcpy.MakeXYEventLayer_management("weekly.csv", "X_LON", "Y_LAT",
"test_points", "O:xyzabcDevelopmentWGS_1984.prj")
... arcpy.ApplySymbologyFromLayer_management("test_points",
"O:xyzabcDevelopmentdatadata_template.lyr")
... mxd = arcpy.mapping.MapDocument("CURRENT")
... for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
... if elm.text == "Old Map Title":
... elm.text = "New Map Title"
... mxd = arcpy.mapping.MapDocument("CURRENT")
... out_png = (r"O:xyzabcDevelopmentexportsweekly.png")
... arcpy.mapping.ExportToPNG(mxd, out_png)
... del mxd




I was able to add the output of the xy event to the dataframe, but I still cant get any symbology.



I need to import symbology from another layer file using the value field. But I am getting an error



symbologyFields = ["VALUE_FIELD", "PCP_WKLY", "PCP_WKLY"] 
arcpy.ApplySymbologyFromLayer_management(temp_Shape,
"O:\XYZ\ABC\Development\data_template.lyr", symbologyFields)
ApplySymbologyFromLayer() takes at most 2 arguments (3 given)









share|improve this question
















I need to create a shapefile from a csv, apply symbology from a saved layer, and export the result into an PNG.



My code works up through the shapefile creation part, but it is not applying the symbology and not adding the layer to the active mxd so that I can export into an PNG.



Similar code works within the python window (see second code block) but does not as a standalone script in a custom toolbox.



Any thoughts on how to apply the symbology and add to current data frame?



Standalone Script that does not work:



import os
import arcpy
from arcpy import env

path = 'O:\xyz\abc\Development\'
inDir = path + 'data\'

try:

#set variables
arcpy.env.overwriteOutput = True
arcpy.env.workspace = path
in_Table = "weekly.csv"
x_coords = "X_LON"
y_coords = "Y_LAT"
out_Layer = "test_points"
saved_Layer = "data_template.lyr"
mxd = "template.mxd"
spRef = "WGS_1984.prj"

#delete old layer so new layer can be called same
arcpy.Delete_management(out_Layer + ".shp")

#create feature class from csv
arcpy.MakeXYEventLayer_management(in_Table, x_coords, y_coords,
out_Layer, spRef)

#convert feature class to shapefile
arcpy.FeatureClassToShapefile_conversion(out_Layer, path)

#apply symbology to shapefile
arcpy.ApplySymbologyFromLayer_management(out_Layer, saved_Layer)

#get the data frame
df = mxd.activeDataFrame

#add the layer to the map at the top
arcpy.mapping.AddLayer(df, out_Layer, "TOP")

except Exception:
print(arcpy.GetMessages())


Python Window code that works as expected:



>>> import arcpy
... arcpy.env.overwriteOutput = True
... arcpy.env.workspace = "O:xyzabcDevelopmentdata"
... arcpy.MakeXYEventLayer_management("weekly.csv", "X_LON", "Y_LAT",
"test_points", "O:xyzabcDevelopmentWGS_1984.prj")
... arcpy.ApplySymbologyFromLayer_management("test_points",
"O:xyzabcDevelopmentdatadata_template.lyr")
... mxd = arcpy.mapping.MapDocument("CURRENT")
... for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
... if elm.text == "Old Map Title":
... elm.text = "New Map Title"
... mxd = arcpy.mapping.MapDocument("CURRENT")
... out_png = (r"O:xyzabcDevelopmentexportsweekly.png")
... arcpy.mapping.ExportToPNG(mxd, out_png)
... del mxd




I was able to add the output of the xy event to the dataframe, but I still cant get any symbology.



I need to import symbology from another layer file using the value field. But I am getting an error



symbologyFields = ["VALUE_FIELD", "PCP_WKLY", "PCP_WKLY"] 
arcpy.ApplySymbologyFromLayer_management(temp_Shape,
"O:\XYZ\ABC\Development\data_template.lyr", symbologyFields)
ApplySymbologyFromLayer() takes at most 2 arguments (3 given)






arcpy






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 24 '18 at 11:19









PolyGeo

54k1782246




54k1782246










asked Jan 11 '18 at 15:55









ncwxpantherncwxpanther

62




62













  • Try adding the layer first then apply the symbology

    – Keagan Allan
    Jan 11 '18 at 17:26



















  • Try adding the layer first then apply the symbology

    – Keagan Allan
    Jan 11 '18 at 17:26

















Try adding the layer first then apply the symbology

– Keagan Allan
Jan 11 '18 at 17:26





Try adding the layer first then apply the symbology

– Keagan Allan
Jan 11 '18 at 17:26










3 Answers
3






active

oldest

votes


















2














As Keagan already pointed out, only layers in a dataframe can have a symbology. You need to add the layer first and apply the symbology afterwards.



I assume, in you second script the output of the xy event gets added directly to the dataframe. In a standalone version you have to add it explicitly.






share|improve this answer































    0














    The error message you are getting:



    ApplySymbologyFromLayer() takes at most 2 arguments (3 given)


    is due to the fact the ApplySymbologyFromLayer() tool is different in ArcGIS Pro.



    Earlier versions (ArcGIS 10.5 and below) only take two arguments:
    i.e.
    ApplySymbologyFromLayer_management (in_layer, in_symbology_layer)



    You're trying to use the symbologyFields as your argument #3, which doesn't actually exist for the toll you're trying to use).



    arcpy.ApplySymbologyFromLayer_management(temp_Shape, 
    "O:\XYZ\ABC\Development\data_template.lyr", symbologyFields)


    The symbologyFields argument is a good improvement to the tool, it just doesn't exist outside of ArcGIS Pro.






    share|improve this answer
























    • Also worth noting - you probably don't need the symbologyFields here anyways; your field names are matching, which is the default, so remove this argument from your tool and it will probably work fine. symbologyFields = ["VALUE_FIELD", "PCP_WKLY", "PCP_WKLY"] If you did need to make your field names match, you could use arcpy.AlterField_management

      – grego
      Mar 14 '18 at 19:43



















    0














    Try to call arcpy.mapping.UpdateLayer (df, update_layer, source_layer) and then arcpy.RefrefshTOC () and arcpy.RefreshActiveView()






    share|improve this answer
























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "79"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f267669%2farcpy-apply-symbology-to-feature-and-add-to-data-frame%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      As Keagan already pointed out, only layers in a dataframe can have a symbology. You need to add the layer first and apply the symbology afterwards.



      I assume, in you second script the output of the xy event gets added directly to the dataframe. In a standalone version you have to add it explicitly.






      share|improve this answer




























        2














        As Keagan already pointed out, only layers in a dataframe can have a symbology. You need to add the layer first and apply the symbology afterwards.



        I assume, in you second script the output of the xy event gets added directly to the dataframe. In a standalone version you have to add it explicitly.






        share|improve this answer


























          2












          2








          2







          As Keagan already pointed out, only layers in a dataframe can have a symbology. You need to add the layer first and apply the symbology afterwards.



          I assume, in you second script the output of the xy event gets added directly to the dataframe. In a standalone version you have to add it explicitly.






          share|improve this answer













          As Keagan already pointed out, only layers in a dataframe can have a symbology. You need to add the layer first and apply the symbology afterwards.



          I assume, in you second script the output of the xy event gets added directly to the dataframe. In a standalone version you have to add it explicitly.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 14 '18 at 14:04









          ThomasThomas

          85749




          85749

























              0














              The error message you are getting:



              ApplySymbologyFromLayer() takes at most 2 arguments (3 given)


              is due to the fact the ApplySymbologyFromLayer() tool is different in ArcGIS Pro.



              Earlier versions (ArcGIS 10.5 and below) only take two arguments:
              i.e.
              ApplySymbologyFromLayer_management (in_layer, in_symbology_layer)



              You're trying to use the symbologyFields as your argument #3, which doesn't actually exist for the toll you're trying to use).



              arcpy.ApplySymbologyFromLayer_management(temp_Shape, 
              "O:\XYZ\ABC\Development\data_template.lyr", symbologyFields)


              The symbologyFields argument is a good improvement to the tool, it just doesn't exist outside of ArcGIS Pro.






              share|improve this answer
























              • Also worth noting - you probably don't need the symbologyFields here anyways; your field names are matching, which is the default, so remove this argument from your tool and it will probably work fine. symbologyFields = ["VALUE_FIELD", "PCP_WKLY", "PCP_WKLY"] If you did need to make your field names match, you could use arcpy.AlterField_management

                – grego
                Mar 14 '18 at 19:43
















              0














              The error message you are getting:



              ApplySymbologyFromLayer() takes at most 2 arguments (3 given)


              is due to the fact the ApplySymbologyFromLayer() tool is different in ArcGIS Pro.



              Earlier versions (ArcGIS 10.5 and below) only take two arguments:
              i.e.
              ApplySymbologyFromLayer_management (in_layer, in_symbology_layer)



              You're trying to use the symbologyFields as your argument #3, which doesn't actually exist for the toll you're trying to use).



              arcpy.ApplySymbologyFromLayer_management(temp_Shape, 
              "O:\XYZ\ABC\Development\data_template.lyr", symbologyFields)


              The symbologyFields argument is a good improvement to the tool, it just doesn't exist outside of ArcGIS Pro.






              share|improve this answer
























              • Also worth noting - you probably don't need the symbologyFields here anyways; your field names are matching, which is the default, so remove this argument from your tool and it will probably work fine. symbologyFields = ["VALUE_FIELD", "PCP_WKLY", "PCP_WKLY"] If you did need to make your field names match, you could use arcpy.AlterField_management

                – grego
                Mar 14 '18 at 19:43














              0












              0








              0







              The error message you are getting:



              ApplySymbologyFromLayer() takes at most 2 arguments (3 given)


              is due to the fact the ApplySymbologyFromLayer() tool is different in ArcGIS Pro.



              Earlier versions (ArcGIS 10.5 and below) only take two arguments:
              i.e.
              ApplySymbologyFromLayer_management (in_layer, in_symbology_layer)



              You're trying to use the symbologyFields as your argument #3, which doesn't actually exist for the toll you're trying to use).



              arcpy.ApplySymbologyFromLayer_management(temp_Shape, 
              "O:\XYZ\ABC\Development\data_template.lyr", symbologyFields)


              The symbologyFields argument is a good improvement to the tool, it just doesn't exist outside of ArcGIS Pro.






              share|improve this answer













              The error message you are getting:



              ApplySymbologyFromLayer() takes at most 2 arguments (3 given)


              is due to the fact the ApplySymbologyFromLayer() tool is different in ArcGIS Pro.



              Earlier versions (ArcGIS 10.5 and below) only take two arguments:
              i.e.
              ApplySymbologyFromLayer_management (in_layer, in_symbology_layer)



              You're trying to use the symbologyFields as your argument #3, which doesn't actually exist for the toll you're trying to use).



              arcpy.ApplySymbologyFromLayer_management(temp_Shape, 
              "O:\XYZ\ABC\Development\data_template.lyr", symbologyFields)


              The symbologyFields argument is a good improvement to the tool, it just doesn't exist outside of ArcGIS Pro.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Mar 14 '18 at 19:30









              gregogrego

              1178




              1178













              • Also worth noting - you probably don't need the symbologyFields here anyways; your field names are matching, which is the default, so remove this argument from your tool and it will probably work fine. symbologyFields = ["VALUE_FIELD", "PCP_WKLY", "PCP_WKLY"] If you did need to make your field names match, you could use arcpy.AlterField_management

                – grego
                Mar 14 '18 at 19:43



















              • Also worth noting - you probably don't need the symbologyFields here anyways; your field names are matching, which is the default, so remove this argument from your tool and it will probably work fine. symbologyFields = ["VALUE_FIELD", "PCP_WKLY", "PCP_WKLY"] If you did need to make your field names match, you could use arcpy.AlterField_management

                – grego
                Mar 14 '18 at 19:43

















              Also worth noting - you probably don't need the symbologyFields here anyways; your field names are matching, which is the default, so remove this argument from your tool and it will probably work fine. symbologyFields = ["VALUE_FIELD", "PCP_WKLY", "PCP_WKLY"] If you did need to make your field names match, you could use arcpy.AlterField_management

              – grego
              Mar 14 '18 at 19:43





              Also worth noting - you probably don't need the symbologyFields here anyways; your field names are matching, which is the default, so remove this argument from your tool and it will probably work fine. symbologyFields = ["VALUE_FIELD", "PCP_WKLY", "PCP_WKLY"] If you did need to make your field names match, you could use arcpy.AlterField_management

              – grego
              Mar 14 '18 at 19:43











              0














              Try to call arcpy.mapping.UpdateLayer (df, update_layer, source_layer) and then arcpy.RefrefshTOC () and arcpy.RefreshActiveView()






              share|improve this answer




























                0














                Try to call arcpy.mapping.UpdateLayer (df, update_layer, source_layer) and then arcpy.RefrefshTOC () and arcpy.RefreshActiveView()






                share|improve this answer


























                  0












                  0








                  0







                  Try to call arcpy.mapping.UpdateLayer (df, update_layer, source_layer) and then arcpy.RefrefshTOC () and arcpy.RefreshActiveView()






                  share|improve this answer













                  Try to call arcpy.mapping.UpdateLayer (df, update_layer, source_layer) and then arcpy.RefrefshTOC () and arcpy.RefreshActiveView()







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 25 mins ago









                  Андрей ТарасовАндрей Тарасов

                  11




                  11






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f267669%2farcpy-apply-symbology-to-feature-and-add-to-data-frame%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Щит и меч (фильм) Содержание Названия серий | Сюжет |...

                      Венесуэла на летних Олимпийских играх 2000 Содержание Состав...

                      Meter-Bus Содержание Параметры шины | Стандартизация |...