<?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: Slow IGxlayer access/broken links in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/slow-igxlayer-access-broken-links/m-p/465348#M12648</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I got pulled away from this project and have not gotten back to it because now my boss wants to do this in Python instead of C# and I'm not the Python programmer in our group.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry I couldn't be of more help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Carlos&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Jul 2012 13:41:58 GMT</pubDate>
    <dc:creator>CarlosPiccirillo</dc:creator>
    <dc:date>2012-07-25T13:41:58Z</dc:date>
    <item>
      <title>Slow IGxlayer access/broken links</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/slow-igxlayer-access-broken-links/m-p/465346#M12646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to write some code that will check a layer file for broken links when the layer gets loaded in code. The code below works fine but the very first line (red line of code below) where it checks to see if the layer file has a group layer is very slow. It's taking 25 to 30 seconds consistently and I don't know why. The code below is part of a much larger program and since this script will be used every time a layer is loaded, I cannot have it taking 30 seconds for every layer because in certain cituations, 30 to 40 layers can get loaded one after another.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your time to read this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Carlos&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;internal static bool IsLayerFileValid(IGxLayer pGxLayer)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; ICompositeLayer pCompositeLayer = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp; IGroupLayer pGroupLayer = new GroupLayerClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp; ILayer pLayer = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp; IEnumLayer pEnumLayer = null;

&amp;nbsp;&amp;nbsp;&amp;nbsp; try
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
 if (!(pGxLayer.Layer is IGroupLayer)) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (pGxLayer.Layer.Valid == false)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp; return false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
 }
 else
 {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //pGroupLayer = pGxLayer.Layer as IGroupLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pCompositeLayer = pGxLayer.Layer as ICompositeLayer;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int counter = 0; counter &amp;lt; pCompositeLayer.Count; counter++)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp; pLayer = pCompositeLayer.get_Layer(counter);

&amp;nbsp; if (pLayer.Valid == false)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;
&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
 }

 return true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (Exception ex)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
 MessageBox.Show(ex.Message);
 return false;
 //throw;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:30:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/slow-igxlayer-access-broken-links/m-p/465346#M12646</guid>
      <dc:creator>CarlosPiccirillo</dc:creator>
      <dc:date>2021-12-12T16:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Slow IGxlayer access/broken links</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/slow-igxlayer-access-broken-links/m-p/465347#M12647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Carlos --- did you resolve this issue or make any progress?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2012 13:35:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/slow-igxlayer-access-broken-links/m-p/465347#M12647</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2012-07-25T13:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Slow IGxlayer access/broken links</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/slow-igxlayer-access-broken-links/m-p/465348#M12648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I got pulled away from this project and have not gotten back to it because now my boss wants to do this in Python instead of C# and I'm not the Python programmer in our group.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry I couldn't be of more help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Carlos&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2012 13:41:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/slow-igxlayer-access-broken-links/m-p/465348#M12648</guid>
      <dc:creator>CarlosPiccirillo</dc:creator>
      <dc:date>2012-07-25T13:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Slow IGxlayer access/broken links</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/slow-igxlayer-access-broken-links/m-p/465349#M12649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;James,&lt;BR /&gt;&lt;BR /&gt;I got pulled away from this project and have not gotten back to it because now my boss wants to do this in Python instead of C# and I'm not the Python programmer in our group.&lt;BR /&gt;&lt;BR /&gt;Sorry I couldn't be of more help.&lt;BR /&gt;&lt;BR /&gt;Carlos&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh you will love all of that Python -- it' such a clean programming language to write (ha) &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No problem --- good luck!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2012 13:49:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/slow-igxlayer-access-broken-links/m-p/465349#M12649</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2012-07-25T13:49:56Z</dc:date>
    </item>
  </channel>
</rss>

