4

I am trying to send multiples input features to the Geoprocessing.IGeoProcessor (to do an Intersect). I am doing this because I can't add the layer path since one of them is from ArcSDE. The example on the ESRI website is incomplete:

Building a custom geoprocessing function tool

[VB.NET]
' Multivalue parameter of Feature Layers/Feature Classes.'
Dim inputParameter As IGPParameterEdit3 = New GPParameterClass()
Dim inputType As IGPDataType = New GPFeatureLayerTypeClass()
Dim mvType As IGPMultiValue = New GPMultiValueClass()
mvType.MemberDataType = inputType
Dim mvValue As IGPMultiValue = New GPMultiValueClass()
mvValue.MemberDataType = inputType
inputFeatures.Name = "input_features"
inputFeatures.DisplayName = "Input Features"
inputFeatures.ParameterType = esriGPParameterType.esriGPParameterTypeRequired
inputFeatures.Direction = esriGPParameterDirection.esriGPParameterDirectionInput
inputFeatures.DataType = CType(mvType, IGPDataType)
inputFeatures.Value = CType(mvValue, IGPValue)
parameters.Add(inputFeatures)

There is no code to actually add the feature layer to the input features list. I tried to add my feature layer with :

mvValue.AddValue(lFeatureLayer)

and I got a invalid COM interface cast exception. What is the real way to do this?

Midavalo
30k11 gold badges53 silver badges108 bronze badges
asked Sep 29, 2016 at 15:44

1 Answer 1

1

If you want to create a new geoprocessing tool like in your example, then you do not add the layer yourself. This is doing the tool for you during running it.

But I think you want to consume an already existing tool (like intersect). This is explained in How to run a geoprocessing tool

answered Oct 18, 2016 at 8:19
1
  • I ended up doing something else because it doesn't work. Like I said, I must use the IfeatureLayer object because I can't use a path for ArcSDE. Anyway, I don't need an answer anymore. Thanks! Commented Oct 20, 2016 at 15:31

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.