<?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: Deleting a subtype from SubtypeGroupLayer or CIMSubtypeGroupLayer in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/deleting-a-subtype-from-subtypegrouplayer-or/m-p/1152629#M52635</link>
    <description>&lt;P&gt;Managed to figure this out after poking around again this morning. Rather than remove the subtype from the Subtype group layer itself, I just had to remove it through the map/layer container that I created the SubtypeGroupLayer in instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var subtypeGroupLayerCreateParam = new SubtypeGroupLayerCreationParams(new Uri(layerInfo.LayerFilePath));
SubtypeGroupLayer layer = LayerFactory.Instance.CreateLayer&amp;lt;SubtypeGroupLayer&amp;gt;(subtypeGroupLayerCreateParam, layerContainerEdit, LayerPosition.AddToBottom);
var layerToRemove = layer.Layers[1];
layerContainerEdit.RemoveLayer(layerToRemove);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 19:04:37 GMT</pubDate>
    <dc:creator>RichardOxales</dc:creator>
    <dc:date>2022-03-10T19:04:37Z</dc:date>
    <item>
      <title>Deleting a subtype from SubtypeGroupLayer or CIMSubtypeGroupLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/deleting-a-subtype-from-subtypegrouplayer-or/m-p/1152415#M52611</link>
      <description>&lt;P&gt;In the ArcGIS Pro SDK, I'm attempting to delete a subtype from a Subtype Group Layer, but in reading the API Reference Guide and trying out a few things, I'm not seeing a way to currently do this, as of ArcGIS Pro 2.9.&lt;/P&gt;&lt;P&gt;The closest I've gotten was to create the SubtypeGroupLayer object using SubtypeGroupLayerCreationParams and pointed to the layer file, where the subtype I want to delete isn't present, but this isn't ideal because I want to be able to use a data connection that isn't necessarily the same as the one in the layer file.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;subtypeGroupLayerCreateParam = new SubtypeGroupLayerCreationParams(new Uri(layerInfo.LayerFilePath));
SubtypeGroupLayer layer = LayerFactory.Instance.CreateLayer&amp;lt;SubtypeGroupLayer&amp;gt;(subtypeGroupLayerCreateParam, layerContainerEdit, LayerPosition.AddToBottom);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to do so from the CIM object, by removing the subtype from the SubtypeLayers and setting the new definition to the layer, but while the definition shows the new list, it doesn't update the Subtype layers on the layer object.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var def = layer.GetDefinition() as CIMSubtypeGroupLayer; // layer has W, X, Y, and Z subtypes.
var newLayerUriArray = new string[] { "X", "Y", "Z" };
def.SubtypeLayers = newLayerUriArray;
layer.SetDefinition(def); // Layer still has W, X, Y, and Z subtypes
var updatedDef = layer.GetDefinition(def); // Definition Subtypes correctly has only X, Y, and Z subtypes&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there currently a way to remove a subtype programmatically? A regular group layer has this capability, but I need to be able to do this on a subtype group layer.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 01:36:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/deleting-a-subtype-from-subtypegrouplayer-or/m-p/1152415#M52611</guid>
      <dc:creator>RichardOxales</dc:creator>
      <dc:date>2022-03-10T01:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting a subtype from SubtypeGroupLayer or CIMSubtypeGroupLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/deleting-a-subtype-from-subtypegrouplayer-or/m-p/1152629#M52635</link>
      <description>&lt;P&gt;Managed to figure this out after poking around again this morning. Rather than remove the subtype from the Subtype group layer itself, I just had to remove it through the map/layer container that I created the SubtypeGroupLayer in instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var subtypeGroupLayerCreateParam = new SubtypeGroupLayerCreationParams(new Uri(layerInfo.LayerFilePath));
SubtypeGroupLayer layer = LayerFactory.Instance.CreateLayer&amp;lt;SubtypeGroupLayer&amp;gt;(subtypeGroupLayerCreateParam, layerContainerEdit, LayerPosition.AddToBottom);
var layerToRemove = layer.Layers[1];
layerContainerEdit.RemoveLayer(layerToRemove);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 19:04:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/deleting-a-subtype-from-subtypegrouplayer-or/m-p/1152629#M52635</guid>
      <dc:creator>RichardOxales</dc:creator>
      <dc:date>2022-03-10T19:04:37Z</dc:date>
    </item>
  </channel>
</rss>

