I am using ArcObjects (ArcGIS 10.1) in .NET with some geoprocessing. It works great. There is an option to add the resulting feature class to the map. That works great too. However how do I get a reference to this layer to move it to a group layer?

Dim GP As GeoProcessor = New GeoProcessor
GP.AddOutputsToMap = True 'True if we want to add outputs to map, False if we dont.

Dim parameters As IVariantArray = New VarArray

Dim res As IGeoProcessorResult = GP.Execute("Merge_management", parameters, Nothing)
'todo: how do I get a reference to ILayer of the resulting layer added to map?

1 Answer 1


The following in VBA shows how to create a layer object that you could then add to a group layer in the map.

Dim res As IGeoProcessorResult
If res.Status = esriJobSucceeded Then
    Dim pGPUtil As IGPUtilities4
    Set pGPUtil = New GPUtilities
    Dim pFL As IFeatureLayer
    Set pFL = pGPUtil.OpenFeatureLayerFromString(toPointFullName)
End If
  • Ahh didn't know u could do that. Let me give that a shot.
    – sinDizzy
    May 30, 2015 at 16:03
  • Works great except I changed it to OpenFeatureClassFromString which gave me a feature class then i could turn that into a layer object. Thanks!
    – sinDizzy
    Jun 1, 2015 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.