<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Copying Text Symbol using Python in ArcGIS Pro in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/copying-text-symbol-using-python-in-arcgis-pro/m-p/190071#M14597</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on a script that takes a subset copy of a layer, and I'd like to make sure the Text Symbol used for Label Class gets maintained. While working in the map, using the "Apply Symbology From Layer Tool" (from the Data Management Toolbox) applys the text symbology to the input layer from the symbology layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, using the same tool in the Python Window does not copy over the text symbology. The code is retrieved from the geoprocessing&amp;nbsp;history&amp;nbsp; by using "Copy Python Command"; the&amp;nbsp;command looks like:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;arcpy.management.ApplySymbologyFromLayer("WGRES_Layer_", "WGRES_Layer", None, "DEFAULT")&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;I noticed that the command's syntax is listed as slightly different on &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/apply-symbology-from-layer.htm"&gt;the ESRI documentation for the tool&lt;/A&gt;; but the resulting command still does not have any effect on the text symbology in the map (&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my research, i also noticed that there is a manual way to get the symbology by accessing the layer object in ArcPy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;import arcpy&lt;BR /&gt;aprx = arcpy.mp.ArcGISProject("current")&lt;BR /&gt;m = aprx.listMaps("Map")[0]&lt;BR /&gt;lyr = m.listLayers("WGRES_Layer")[0]&lt;BR /&gt;sym = lyr.symbology&lt;BR /&gt;newlyr = m.listLayers("WGRES_Layer_")[0]&lt;BR /&gt;newlyr.symbology = sym&lt;BR /&gt;aprx.save()&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;I'm not sure what I'm missing here. Does anyone know of any other ways to use python to edit the text symbology for a label class?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Oct 2018 19:36:19 GMT</pubDate>
    <dc:creator>MaxReis</dc:creator>
    <dc:date>2018-10-09T19:36:19Z</dc:date>
    <item>
      <title>Copying Text Symbol using Python in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/copying-text-symbol-using-python-in-arcgis-pro/m-p/190071#M14597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on a script that takes a subset copy of a layer, and I'd like to make sure the Text Symbol used for Label Class gets maintained. While working in the map, using the "Apply Symbology From Layer Tool" (from the Data Management Toolbox) applys the text symbology to the input layer from the symbology layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, using the same tool in the Python Window does not copy over the text symbology. The code is retrieved from the geoprocessing&amp;nbsp;history&amp;nbsp; by using "Copy Python Command"; the&amp;nbsp;command looks like:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;arcpy.management.ApplySymbologyFromLayer("WGRES_Layer_", "WGRES_Layer", None, "DEFAULT")&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;I noticed that the command's syntax is listed as slightly different on &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/apply-symbology-from-layer.htm"&gt;the ESRI documentation for the tool&lt;/A&gt;; but the resulting command still does not have any effect on the text symbology in the map (&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my research, i also noticed that there is a manual way to get the symbology by accessing the layer object in ArcPy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;import arcpy&lt;BR /&gt;aprx = arcpy.mp.ArcGISProject("current")&lt;BR /&gt;m = aprx.listMaps("Map")[0]&lt;BR /&gt;lyr = m.listLayers("WGRES_Layer")[0]&lt;BR /&gt;sym = lyr.symbology&lt;BR /&gt;newlyr = m.listLayers("WGRES_Layer_")[0]&lt;BR /&gt;newlyr.symbology = sym&lt;BR /&gt;aprx.save()&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;I'm not sure what I'm missing here. Does anyone know of any other ways to use python to edit the text symbology for a label class?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2018 19:36:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/copying-text-symbol-using-python-in-arcgis-pro/m-p/190071#M14597</guid>
      <dc:creator>MaxReis</dc:creator>
      <dc:date>2018-10-09T19:36:19Z</dc:date>
    </item>
  </channel>
</rss>

