<?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 Re: Add a layer name to layer attribute tables in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1144577#M51552</link>
    <description>&lt;P&gt;&lt;EM&gt;parse the featureclass table name from either the layer name or the source name on disk&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;you have to provide the code when cycling through the featureclasses to get the featureclass name "before" you invoke a field calculation... This has to be done using an updatecursor in a python script, you just can't use CalculateField on its own&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Feb 2022 13:29:00 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2022-02-16T13:29:00Z</dc:date>
    <item>
      <title>Add a layer name to layer attribute tables</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1143954#M51470</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;is it possible to programmatically insert the layer name into its attribute table?&lt;/P&gt;&lt;P&gt;Is it possible to write it down via Calculate Field?&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;My problem has moved on to the next stage.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var AL016 = "MS_FT_AL016_T";
                var NF103 = "MS_FT_NF103_T";
                var NF109 = "MS_FT_NF109_T";
                var NF121 = "MS_FT_NF121_T";
                var NF127 = "MS_FT_NF127_T";
                var NF128 = "MS_FT_NF128_T";
                var FTJmeno = "MS_FT_JMENO_P_T";
 List&amp;lt;string&amp;gt; names = new List&amp;lt;string&amp;gt;();
                names.Add(AL016);
                names.Add(NF103);
                names.Add(NF109);
                names.Add(NF121);
                names.Add(NF127);
                names.Add(NF128);
names.Add(FTJmeno);
                foreach (var name in names)
                {
                    FeatureLayer featureLayer = mv.Map.FindLayers(name).First() as FeatureLayer;
                    FeatureClass fc = featureLayer.GetTable() as FeatureClass;
                    await AddField(fc, typObjektu, "TEXT", "", "", 10);
                    object[] paraList = { fc, typObjektu, "\\" + name+"\\" };
                    await StartATask("management.CalculateField", paraList);
                }&lt;/LI-CODE&gt;&lt;P&gt;Here is my code, where I can't prevent "name" from being written to my attribute table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 06:37:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1143954#M51470</guid>
      <dc:creator>DavidMrázek</dc:creator>
      <dc:date>2022-02-16T06:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Add a layer name to layer attribute tables</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1144001#M51479</link>
      <description>&lt;P&gt;You would have to add the table name to a field and it would be replicated by the number of records.&lt;/P&gt;&lt;P&gt;A table associated with geometry will be referenced by the featureclass.&lt;/P&gt;&lt;P&gt;A standalone table already has a name since it has to be referenced to disk.&lt;/P&gt;&lt;P&gt;There are data structures that enable comments to be embedded into the file (aka, table) so you can put a "name" in there (eg numpy arrays saved to disk as *.npz files)&lt;/P&gt;&lt;P&gt;Perhaps the purpose for needing this would be useful.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 12:29:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1144001#M51479</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-02-15T12:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Add a layer name to layer attribute tables</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1144013#M51482</link>
      <description>&lt;P&gt;I thought of it this way: A layer has an attribute table that contains a column, I would like to add to that column the name of the layer that is the table.&lt;/P&gt;&lt;P&gt;Shown in the picture&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vysve.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33925i77F685937A6ED169/image-size/large?v=v2&amp;amp;px=999" role="button" title="vysve.png" alt="vysve.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Instead of name, I would like the name of the layer.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 13:07:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1144013#M51482</guid>
      <dc:creator>DavidMrázek</dc:creator>
      <dc:date>2022-02-15T13:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Add a layer name to layer attribute tables</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1144141#M51500</link>
      <description>&lt;P&gt;just use Calculate Field, give it a name and make it text,&lt;/P&gt;&lt;P&gt;parse the featureclass table name from either the layer name or the source name on disk&lt;/P&gt;&lt;P&gt;pass the string to Calculate field&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field.htm" target="_blank"&gt;Calculate Field (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;just be aware that passing strings requires single quoted, double quoted strings&amp;nbsp; &amp;nbsp;'"single_around_double"'&lt;/P&gt;&lt;P&gt;Then you would have the table name in the table for however many records you have, but it will bloat the table size as you are aware&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 16:44:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1144141#M51500</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-02-15T16:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Add a layer name to layer attribute tables</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1144505#M51540</link>
      <description>&lt;P&gt;So I'm making a mistake there, that's why I still can't, my attempt to write doesn't work: "\" "+ name +" \ ""&lt;/P&gt;&lt;P&gt;"name" is a changing value in foreach&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 05:43:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1144505#M51540</guid>
      <dc:creator>DavidMrázek</dc:creator>
      <dc:date>2022-02-16T05:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Add a layer name to layer attribute tables</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1144577#M51552</link>
      <description>&lt;P&gt;&lt;EM&gt;parse the featureclass table name from either the layer name or the source name on disk&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;you have to provide the code when cycling through the featureclasses to get the featureclass name "before" you invoke a field calculation... This has to be done using an updatecursor in a python script, you just can't use CalculateField on its own&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 13:29:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1144577#M51552</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-02-16T13:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Add a layer name to layer attribute tables</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1145072#M51636</link>
      <description>&lt;P&gt;Thank you for the advice, but I have no idea, maybe a mistake in my language skills.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 09:35:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/add-a-layer-name-to-layer-attribute-tables/m-p/1145072#M51636</guid>
      <dc:creator>DavidMrázek</dc:creator>
      <dc:date>2022-02-17T09:35:43Z</dc:date>
    </item>
  </channel>
</rss>

