<?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 Default Language for Label Class in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/default-language-for-label-class/m-p/1352436#M75458</link>
    <description>&lt;P&gt;I want to apply labeling in multiple layers using Arcade Expression in ArcGIS Pro, So I created below python script, and I also set Arcade to apply labeling:&amp;nbsp;&lt;SPAN&gt;label_class&lt;/SPAN&gt;&lt;SPAN&gt;.expression &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"Arcade".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But problem is- Arcade language changes to VBScript or other language other than Arcade after running the script. I have to set manually Arcade each time for each layer, then apply the script, and then work. What is the solution to set default Language Arcade that will not change after running the script?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

def set_labels():

    aprx = arcpy.mp.ArcGISProject("CURRENT")
    m = aprx.listMaps()[0]

    layer_types = ["PD", "LD"]
    name_field_mapping = {
        "PD": ["P_Desc", "Label_En", "Label_Bn"],
        "LD": ["L_Desc"],
    }

    for lyr in m.listLayers():
        for layer_type in layer_types:
            if layer_type in lyr.name:

                if lyr.supports("SHOWLABELS"):
                    if not lyr.listLabelClasses():
                        label_class = lyr.labelClasses[0]
                    else:
                        label_class = lyr.listLabelClasses()[0]

                    # Setting label expression language to Arcade
                    label_class.expression = "Arcade"
                    if layer_type == "PD":
                        label_expression = """ "&amp;lt;BSE&amp;gt;"+"&amp;lt;ALIGN horizontal = 'middle'&amp;gt;"+"&amp;lt;FNT name = 'Work Sans' style = 'italic' named_instance = 'bold italic' wght = '700' size = '13'&amp;gt;" + "&amp;lt;CLR blue = '255'&amp;gt;" + $feature.P_Desc + "&amp;lt;/CLR&amp;gt;" +TextFormatting.NewLine+"&amp;lt;BOL&amp;gt;" + "&amp;lt;CLR red='255' green='236' blue='0' alpha='100'&amp;gt;"+"&amp;lt;BGD red='0' green='0' blue='0' alpha='100'&amp;gt;" +"&amp;lt;_ITA&amp;gt;"+ $feature.Label_En + "&amp;lt;/_ITA&amp;gt;"+"&amp;lt;/BGD&amp;gt;&amp;lt;/CLR&amp;gt;" + "&amp;lt;/BOL&amp;gt;" + TextFormatting.NewLine + "&amp;lt;CLR red='255' green='255' blue='255' alpha='100'&amp;gt;"+"&amp;lt;BGD red='230' green='0' blue='0' alpha='100'&amp;gt;" + $feature.Label_Bn + "&amp;lt;/BGD&amp;gt;&amp;lt;/CLR&amp;gt;" + "&amp;lt;/FNT&amp;gt;"+"&amp;lt;/ALIGN&amp;gt;"+"&amp;lt;/BSE&amp;gt;" """

                    elif layer_type == "LD":
                        label_expression = """ "&amp;lt;BSE&amp;gt;"+"&amp;lt;ALIGN horizontal = 'middle'&amp;gt;" + "&amp;lt;FNT name = 'Work Sans' style = 'italic' named_instance = 'bold italic' wght = '700' size = '13'&amp;gt;" + "&amp;lt;CLR red = '255'&amp;gt;" + $feature.L_Desc + "&amp;lt;/CLR&amp;gt;" + "&amp;lt;/FNT&amp;gt;" + "&amp;lt;/ALIGN&amp;gt;"+ "&amp;lt;/BSE&amp;gt;" """
                        label_class.SQLQuery = "L_Desc &amp;lt;&amp;gt; 'Plot'"
                    else:
                        label_expression = f"${name_field_mapping[layer_type][0]}"

                    label_class.expression = label_expression

                    label_class.showClassLabels = True

                    lyr.showLabels = True

    aprx.save()

set_labels()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Nov 2023 09:19:27 GMT</pubDate>
    <dc:creator>SumanGeo</dc:creator>
    <dc:date>2023-11-22T09:19:27Z</dc:date>
    <item>
      <title>Default Language for Label Class</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/default-language-for-label-class/m-p/1352436#M75458</link>
      <description>&lt;P&gt;I want to apply labeling in multiple layers using Arcade Expression in ArcGIS Pro, So I created below python script, and I also set Arcade to apply labeling:&amp;nbsp;&lt;SPAN&gt;label_class&lt;/SPAN&gt;&lt;SPAN&gt;.expression &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"Arcade".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But problem is- Arcade language changes to VBScript or other language other than Arcade after running the script. I have to set manually Arcade each time for each layer, then apply the script, and then work. What is the solution to set default Language Arcade that will not change after running the script?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

def set_labels():

    aprx = arcpy.mp.ArcGISProject("CURRENT")
    m = aprx.listMaps()[0]

    layer_types = ["PD", "LD"]
    name_field_mapping = {
        "PD": ["P_Desc", "Label_En", "Label_Bn"],
        "LD": ["L_Desc"],
    }

    for lyr in m.listLayers():
        for layer_type in layer_types:
            if layer_type in lyr.name:

                if lyr.supports("SHOWLABELS"):
                    if not lyr.listLabelClasses():
                        label_class = lyr.labelClasses[0]
                    else:
                        label_class = lyr.listLabelClasses()[0]

                    # Setting label expression language to Arcade
                    label_class.expression = "Arcade"
                    if layer_type == "PD":
                        label_expression = """ "&amp;lt;BSE&amp;gt;"+"&amp;lt;ALIGN horizontal = 'middle'&amp;gt;"+"&amp;lt;FNT name = 'Work Sans' style = 'italic' named_instance = 'bold italic' wght = '700' size = '13'&amp;gt;" + "&amp;lt;CLR blue = '255'&amp;gt;" + $feature.P_Desc + "&amp;lt;/CLR&amp;gt;" +TextFormatting.NewLine+"&amp;lt;BOL&amp;gt;" + "&amp;lt;CLR red='255' green='236' blue='0' alpha='100'&amp;gt;"+"&amp;lt;BGD red='0' green='0' blue='0' alpha='100'&amp;gt;" +"&amp;lt;_ITA&amp;gt;"+ $feature.Label_En + "&amp;lt;/_ITA&amp;gt;"+"&amp;lt;/BGD&amp;gt;&amp;lt;/CLR&amp;gt;" + "&amp;lt;/BOL&amp;gt;" + TextFormatting.NewLine + "&amp;lt;CLR red='255' green='255' blue='255' alpha='100'&amp;gt;"+"&amp;lt;BGD red='230' green='0' blue='0' alpha='100'&amp;gt;" + $feature.Label_Bn + "&amp;lt;/BGD&amp;gt;&amp;lt;/CLR&amp;gt;" + "&amp;lt;/FNT&amp;gt;"+"&amp;lt;/ALIGN&amp;gt;"+"&amp;lt;/BSE&amp;gt;" """

                    elif layer_type == "LD":
                        label_expression = """ "&amp;lt;BSE&amp;gt;"+"&amp;lt;ALIGN horizontal = 'middle'&amp;gt;" + "&amp;lt;FNT name = 'Work Sans' style = 'italic' named_instance = 'bold italic' wght = '700' size = '13'&amp;gt;" + "&amp;lt;CLR red = '255'&amp;gt;" + $feature.L_Desc + "&amp;lt;/CLR&amp;gt;" + "&amp;lt;/FNT&amp;gt;" + "&amp;lt;/ALIGN&amp;gt;"+ "&amp;lt;/BSE&amp;gt;" """
                        label_class.SQLQuery = "L_Desc &amp;lt;&amp;gt; 'Plot'"
                    else:
                        label_expression = f"${name_field_mapping[layer_type][0]}"

                    label_class.expression = label_expression

                    label_class.showClassLabels = True

                    lyr.showLabels = True

    aprx.save()

set_labels()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 09:19:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/default-language-for-label-class/m-p/1352436#M75458</guid>
      <dc:creator>SumanGeo</dc:creator>
      <dc:date>2023-11-22T09:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Default Language for Label Class</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/default-language-for-label-class/m-p/1364793#M76796</link>
      <description>&lt;P&gt;I have also run into this issue - commenting to see if anyone has come up with a solution.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 18:02:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/default-language-for-label-class/m-p/1364793#M76796</guid>
      <dc:creator>VeraNeroni1</dc:creator>
      <dc:date>2023-12-28T18:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Default Language for Label Class</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/default-language-for-label-class/m-p/1386363#M79244</link>
      <description>&lt;P&gt;In line 25 you set label_class.expression to "Arcade". Set the&amp;nbsp;&lt;STRONG&gt;expressionEngine&lt;/STRONG&gt; property instead:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;label_class.expressionEngine = 'Arcade'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 23:01:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/default-language-for-label-class/m-p/1386363#M79244</guid>
      <dc:creator>JesseWickizer</dc:creator>
      <dc:date>2024-02-23T23:01:33Z</dc:date>
    </item>
  </channel>
</rss>

