<?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 Add layers to ArcMap from VB.NET form in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/add-layers-to-arcmap-from-vb-net-form/m-p/71745#M1927</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi. I have a VB.NET form that I'm using as a standalone application.&amp;nbsp; On this form, a user can navigate to different files and the file path is stored in a list box.&amp;nbsp; I want the user to be able to click on a file (or files) from the listbox and have those files (which are Feature Layers) get put into the table of contents of an existing ArcMap project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any kind of "load layer from string" command out there? Or anything like that?&amp;nbsp; Please let me know!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Apr 2010 07:17:20 GMT</pubDate>
    <dc:creator>AdrianWelsh</dc:creator>
    <dc:date>2010-04-19T07:17:20Z</dc:date>
    <item>
      <title>Add layers to ArcMap from VB.NET form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/add-layers-to-arcmap-from-vb-net-form/m-p/71745#M1927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi. I have a VB.NET form that I'm using as a standalone application.&amp;nbsp; On this form, a user can navigate to different files and the file path is stored in a list box.&amp;nbsp; I want the user to be able to click on a file (or files) from the listbox and have those files (which are Feature Layers) get put into the table of contents of an existing ArcMap project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any kind of "load layer from string" command out there? Or anything like that?&amp;nbsp; Please let me know!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Apr 2010 07:17:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/add-layers-to-arcmap-from-vb-net-form/m-p/71745#M1927</guid>
      <dc:creator>AdrianWelsh</dc:creator>
      <dc:date>2010-04-19T07:17:20Z</dc:date>
    </item>
    <item>
      <title>Add layers to ArcMap from VB.NET form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/add-layers-to-arcmap-from-vb-net-form/m-p/71746#M1928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;a hopeful bump for the new week...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 20:33:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/add-layers-to-arcmap-from-vb-net-form/m-p/71746#M1928</guid>
      <dc:creator>AdrianWelsh</dc:creator>
      <dc:date>2010-04-26T20:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Add layers to ArcMap from VB.NET form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/add-layers-to-arcmap-from-vb-net-form/m-p/71747#M1929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure if you've had any luck with your issue.&amp;nbsp; Unfortunately, there is no basic "open this layer" command.&amp;nbsp; I'll try to outline some code I have that someone else created. If it seems a bit disorganized and choppy I apologize, I'm adapting it for your use from code we use everyday to add annotation layers to a map.&amp;nbsp; So I'm hoping I can at least get you started on the right track. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
'First, need to have an IFeatureWorkspace.&amp;nbsp; Set your a new feature workspace from your existing workspace
pFeatureWorkspace = pWorkspace

'Create a new feature layer object
Dim pFlayer As New ESRI.ArcGIS.Carto.FeatureLayer

'Set the new object feature class to the open feature class
pFlayer.FeatureClass = pFWkSpc.OpenFeatureClass("MyLayerName")

'You can't add a feature class to an IMap object, it has to be a an FDOGraphicsLayer object so...

'Create a new feature dataset object
Dim pFeatureDataset As ESRI.ArcGIS.Geodatabase.IFeatureDataset

'set the object to the featurelayer dataset 
pFeatureDataset = pFlayer.FeatureClass.FeatureDataset

'create new fdographicslayer and fdographicslayerfactory objects
Dim pFDOGrLayer As ESRI.ArcGIS.Carto.IFDOGraphicsLayer
Dim pFDOGLFactory As ESRI.ArcGIS.Carto.IFDOGraphicsLayerFactory

'The factory must be 'new'
pFDOGLFactory = New ESRI.ArcGIS.Carto.FDOGraphicsLayerFactory

'Then set the layer to the factory opengraphicslayer call with the feature workspace, feature dataset,
and string name of your layer.
pFDOGrLayer = pFDOGLFactory.OpenGraphicsLayer(pFeatureWorkspace, pFeatureDataset, "string name of layer")

'Finally add the fdographicslayer to the map.&amp;nbsp; 
pMap.AddLayer(pFDOGrLayer)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully this works.&amp;nbsp; I haven't tested it, but like I said we use a similar process to add annotation layers so I'm ever so hopeful.&amp;nbsp; Good luck and if this doesn't work for you maybe it can at least set you in the right direction with libraries and such.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:46:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/add-layers-to-arcmap-from-vb-net-form/m-p/71747#M1929</guid>
      <dc:creator>BelindaJerger</dc:creator>
      <dc:date>2021-12-10T22:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Add layers to ArcMap from VB.NET form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/add-layers-to-arcmap-from-vb-net-form/m-p/71748#M1930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If your question is oriented around how to access a feature class or feature layer with its path as a string then you can use methods such as IGPUtilities2::OpenFeatureClassFromString or IGPUtilities2::OpenFeatureLayerFromString. However, if it's oriented around how to add data from a standalone form that's not directly associated with a running ArcGIS application then you will have more work to do. Please post again with additional information if necessary.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 May 2010 18:32:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/add-layers-to-arcmap-from-vb-net-form/m-p/71748#M1930</guid>
      <dc:creator>JohnHauck</dc:creator>
      <dc:date>2010-05-04T18:32:04Z</dc:date>
    </item>
  </channel>
</rss>

