<?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: How to create a field with SDK .NET ? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859211#M4674</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or as it was pointed out to me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;FeatureLayer firstLayer = MapView.Active.Map.Layers.OfType&amp;lt;FeatureLayer&amp;gt;().FirstOrDefault(); 
await QueuedTask.Run(() =&amp;gt; 
{ 
&amp;nbsp;&amp;nbsp; FeatureClass fc = firstLayer.GetTable() as FeatureClass; 
&amp;nbsp;&amp;nbsp; Geoprocessing.ExecuteToolAsync("AddField_management", Geoprocessing.MakeValueArray(fc, "FieldName", "LONG", 9));
});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 10:38:20 GMT</pubDate>
    <dc:creator>ThomasEmge</dc:creator>
    <dc:date>2021-12-12T10:38:20Z</dc:date>
    <item>
      <title>How to create a field with SDK .NET ?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859205#M4668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish to create a new field (column) in the attribute table of a specific layer with the SDK .Net.&lt;/P&gt;&lt;P&gt;It is possible to create a new row (ligne) in the attribute table with createRow(RowBuffer rowbuffer) but a function to create a field don't seem to existe.&lt;/P&gt;&lt;P&gt;I found in the api reference that there was a field class and an attribute class that allow to get information about a field but nothing to actually create one. All the create function that I found allow to create a feature, or a row but not a field.&lt;/P&gt;&lt;P&gt;I also searched in the sample available on github (&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples" title="https://github.com/Esri/arcgis-pro-sdk-community-samples"&gt;Esri/arcgis-pro-sdk-community-samples · GitHub&lt;/A&gt; ).&lt;/P&gt;&lt;P&gt;Maybe I missed something in the api reference.&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 13:42:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859205#M4668</guid>
      <dc:creator>LoicDeichelbohrer</dc:creator>
      <dc:date>2015-10-12T13:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with SDK .NET</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859206#M4669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;I don't know but if it is missing you can use 'add field' of gp (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FEsri%2Farcgis-pro-sdk-community-samples%2Ftree%2Fmaster%2FGeoprocessing" rel="nofollow" target="_blank"&gt;https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Geoprocessing&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 14:11:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859206#M4669</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2015-10-12T14:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with SDK .NET ?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859207#M4670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you say gp, are you talking about &lt;A class="js-navigation-open js-directory-link" href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Geoprocessing/DriveTimeGP" style="color: #4078c0; text-decoration: underline; font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 13px; background-color: #f5f5f5;" title="DriveTimeGP"&gt;DriveTimeGP&lt;/A&gt; ?&lt;/P&gt;&lt;P&gt;Because there aren't any add field in this project.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 14:24:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859207#M4670</guid>
      <dc:creator>LoicDeichelbohrer</dc:creator>
      <dc:date>2015-10-12T14:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with SDK .NET ?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859208#M4671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are not missing anything in the API. The API is designed following the data manipulation language (DML).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to add a field you would make a call using geoprocessing such as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;using ArcGIS.Desktop.Core.Geoprocessing;
await QueuedTask.Run(() =&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Geoprocessing.ExecuteToolAsync("AddField_management", Geoprocessing.MakeValueArray("FieldName", "LONG", 9));
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:38:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859208#M4671</guid>
      <dc:creator>ThomasEmge</dc:creator>
      <dc:date>2021-12-12T10:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with SDK .NET ?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859209#M4672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you but how do you tell this function which attribute table will add the new field ?&lt;/P&gt;&lt;P&gt;And this function use geoprocessing but is it possible to create a field in another way, like the creation of row with createRow() ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 15:28:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859209#M4672</guid>
      <dc:creator>LoicDeichelbohrer</dc:creator>
      <dc:date>2015-10-12T15:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with SDK .NET ?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859210#M4673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My mistake,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first argument is the target table.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="keyword"&gt;using ArcGIS.Desktop.Core.Geoprocessing;&amp;nbsp; &lt;/SPAN&gt;
await QueuedTask.Run(() =&amp;gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Geoprocessing.ExecuteToolAsync(&lt;SPAN class="string"&gt;"AddField_management", Geoprocessing.MakeValueArray(@"c:\temp\demo.gdb\sample", &lt;SPAN class="string"&gt;"FieldName", &lt;/SPAN&gt;&lt;SPAN class="string"&gt;"LONG"&lt;/SPAN&gt;, &lt;SPAN class="number"&gt;9&lt;/SPAN&gt;));&amp;nbsp; &lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you are working with layers in your map this would be that way to get the location:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;FeatureLayer firstLayer = MapView.Active.Map.Layers.OfType&amp;lt;FeatureLayer&amp;gt;().FirstOrDefault();
await QueuedTask.Run(() =&amp;gt;
{ 
 FeatureClass fc = firstLayer.GetTable() as FeatureClass;
 Datastore ds = fc.GetDatastore();
 string dc = ds.GetConnectionString();
 if (ds is Geodatabase)
 {
&amp;nbsp; Geodatabase gdb = fc.GetDatastore() as Geodatabase;
&amp;nbsp; string gdbPath = gdb.GetPath();
 }
 string name = fc.GetName();
});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:38:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859210#M4673</guid>
      <dc:creator>ThomasEmge</dc:creator>
      <dc:date>2021-12-12T10:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with SDK .NET ?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859211#M4674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or as it was pointed out to me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;FeatureLayer firstLayer = MapView.Active.Map.Layers.OfType&amp;lt;FeatureLayer&amp;gt;().FirstOrDefault(); 
await QueuedTask.Run(() =&amp;gt; 
{ 
&amp;nbsp;&amp;nbsp; FeatureClass fc = firstLayer.GetTable() as FeatureClass; 
&amp;nbsp;&amp;nbsp; Geoprocessing.ExecuteToolAsync("AddField_management", Geoprocessing.MakeValueArray(fc, "FieldName", "LONG", 9));
});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:38:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859211#M4674</guid>
      <dc:creator>ThomasEmge</dc:creator>
      <dc:date>2021-12-12T10:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with SDK .NET ?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859212#M4675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for your help.&lt;/P&gt;&lt;P&gt;One last thing, where does the string "AddField_management" come from ?&lt;/P&gt;&lt;P&gt;I didn't find anything about it on the api reference or in the DAML.cs that you can generate in code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2015 07:26:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859212#M4675</guid>
      <dc:creator>LoicDeichelbohrer</dc:creator>
      <dc:date>2015-10-13T07:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with SDK .NET ?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859213#M4676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;you can use toolboxalias.toolname or toolname_toolboxalias pattern.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The data management toolbox has alias 'management' while the name of tool is 'AddField' (click right button of mouse on tool and select property and see the name)&lt;/P&gt;&lt;P&gt;Here in&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdesktop.arcgis.com%2Fen%2Fdesktop%2Flatest%2Fguide-books%2Fextensions%2Ftask-assistant-manager%2Ftask-assistant-manager-faqs.htm" rel="nofollow" target="_blank"&gt;https://desktop.arcgis.com/en/desktop/latest/guide-books/extensions/task-assistant-manager/task-assistant-manager-faqs.htm&lt;/A&gt;&lt;SPAN&gt; you can see the list of alias of toolbox system&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2015 08:04:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859213#M4676</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2015-10-13T08:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with SDK .NET ?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859214#M4677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2015 08:07:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-a-field-with-sdk-net/m-p/859214#M4677</guid>
      <dc:creator>LoicDeichelbohrer</dc:creator>
      <dc:date>2015-10-13T08:07:10Z</dc:date>
    </item>
  </channel>
</rss>

