Select to view content in your preferred language

HowTo :: Input Multiple Parameters for QuickExport GP Tool via AO

924
4
09-21-2010 12:57 AM
UjjwalNigam
Regular Contributor
Hi,
I have been trying to export a layer as GML using ArcObjects (AO).
I am able to do it successfully when there is a single layer in the map, but I could not find any information regarding adding multiple input layers.

Should I simply repeat the code, like:
pParameterEdit.Value = pDataType.CreateValue("test"), replacing test with the new layer name...or,
Should I add multiple layer names within the same string, like:
pParameterEdit.Value = pDataType.CreateValue("test, test2"),

I have used the follwoing code to add input layer:

'Set input/output parameters
       
pParameter = pParamArray.Element(0)
pParameterEdit = pParameter       
pDataType = pParameter.DataType       
pParameterEdit.Value = pDataType.CreateValue("test")  <--- This is where I want to add one more layer as input...
       
'Output Parameter
pParameter = pParamArray.Element(1)
pParameterEdit = pParameter       
pDataType = pParameter.DataType       
pParameterEdit.Value = pDataType.CreateValue("GMLSF, D:\Ujjwal\GMLConversion\test_two.gml")

Many Thanks!

Ujjwal
0 Kudos
4 Replies
JohnHauck
Frequent Contributor
The following document describes some options for dealing with multi-value inputs.

Building a custom geoprocessing function tool

See the "Multiple values" section.
0 Kudos
UjjwalNigam
Regular Contributor
Thanks John!
But I've found the solution...and it's way simpler and something I earlier anticipated.
To export multiple layers, simply delimit the layer names with a semi colon ";"...

pParameterEdit.Value = pDataType.CreateValue("Layer1;Layer2")

Things could get funny at times...I was looking all around for a solution for the last few days...wish I had used a semi-colon instead of a comma 😛

But Thanks again... 🙂
0 Kudos
UjjwalNigam
Regular Contributor
Ok I'm stuck again... 😞
This time it is to do with the UNC path for the output GML file.

If I provide a UNC output path, QuickExport is not able to create a file at the remote location:
2010-10-07 15:17:54| 7.8| 0.0|ERROR |Unable to open output file: '\\172.21.53.82\GML Test\test.xsd'
2010-10-07 15:17:54| 7.8| 0.0|ERROR |<GML Writer> - Unable to create the GML application schema in the specified path '\\172.21.53.82\GML Test\test.xsd'.

PS: Remote location is a shared folder with Read/Write/Modify privilege to everyone.
Local path works fine...any ideas?
0 Kudos
UjjwalNigam
Regular Contributor
OK, I got this working!
Strangely, it accepts a 'mapped drive' but doesn't work with IP!

Ok I'm stuck again... 😞 
This time it is to do with the UNC path for the output GML file.  

If I provide a UNC output path, QuickExport is not able to create a file at the remote location: 
2010-10-07 15:17:54| 7.8| 0.0|ERROR |Unable to open output file: '\\172.21.53.82\GML Test\test.xsd'
2010-10-07 15:17:54| 7.8| 0.0|ERROR |<GML Writer> - Unable to create the GML application schema in the specified path '\\172.21.53.82\GML Test\test.xsd'.


PS: Remote location is a shared folder with Read/Write/Modify privilege to everyone. 
Local path works fine...any ideas?
0 Kudos