<?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 VB.NET Add layer IESRIScriptEngine turn Layer on or off in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/vb-net-add-layer-iesriscriptengine-turn-layer-on/m-p/410280#M4856</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anyone who can help me with this Please&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am try to turn Layer on or off but I get error on this line&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;.AddCode("lyr7.visible = False")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim engine As IESRIScriptEngine = New ESRIScriptEngine&lt;BR /&gt; With engine&lt;BR /&gt; .Language = "python"&lt;/P&gt;&lt;P&gt;.AddCode("import arcpy")&lt;BR /&gt; .AddCode("mxd = arcpy.mapping.MapDocument(""CURRENT"")")&lt;BR /&gt; .AddCode("df = arcpy.mapping.ListDataFrames(mxd)[0]")&lt;BR /&gt; .AddCode("addLayer = arcpy.mapping.Layer(r" &amp;amp; "'" &amp;amp; LYR_file &amp;amp; "'" &amp;amp; ")")&lt;BR /&gt; .AddCode("arcpy.mapping.AddLayer(df, addLayer, ""BOTTOM"")")&lt;/P&gt;&lt;P&gt;.AddCode("lyr7 = arcpy.mapping.ListLayers(mxd, "", df)[0]"")")&lt;BR /&gt; .AddCode("&lt;SPAN&gt;lyr7&lt;/SPAN&gt;.visible = False")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 May 2017 14:40:24 GMT</pubDate>
    <dc:creator>sigurdurgear1</dc:creator>
    <dc:date>2017-05-11T14:40:24Z</dc:date>
    <item>
      <title>VB.NET Add layer IESRIScriptEngine turn Layer on or off</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/vb-net-add-layer-iesriscriptengine-turn-layer-on/m-p/410280#M4856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anyone who can help me with this Please&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am try to turn Layer on or off but I get error on this line&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;.AddCode("lyr7.visible = False")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim engine As IESRIScriptEngine = New ESRIScriptEngine&lt;BR /&gt; With engine&lt;BR /&gt; .Language = "python"&lt;/P&gt;&lt;P&gt;.AddCode("import arcpy")&lt;BR /&gt; .AddCode("mxd = arcpy.mapping.MapDocument(""CURRENT"")")&lt;BR /&gt; .AddCode("df = arcpy.mapping.ListDataFrames(mxd)[0]")&lt;BR /&gt; .AddCode("addLayer = arcpy.mapping.Layer(r" &amp;amp; "'" &amp;amp; LYR_file &amp;amp; "'" &amp;amp; ")")&lt;BR /&gt; .AddCode("arcpy.mapping.AddLayer(df, addLayer, ""BOTTOM"")")&lt;/P&gt;&lt;P&gt;.AddCode("lyr7 = arcpy.mapping.ListLayers(mxd, "", df)[0]"")")&lt;BR /&gt; .AddCode("&lt;SPAN&gt;lyr7&lt;/SPAN&gt;.visible = False")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2017 14:40:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/vb-net-add-layer-iesriscriptengine-turn-layer-on/m-p/410280#M4856</guid>
      <dc:creator>sigurdurgear1</dc:creator>
      <dc:date>2017-05-11T14:40:24Z</dc:date>
    </item>
  </channel>
</rss>

