Geoprocessor - IGPParameterEdit3 and IGPFileDomain domain

1841
2
06-06-2012 12:04 AM
LukaszBarcik
New Contributor
Hi everyone!

I am implementing a geoprocessor tool. I want to have a list of files as an input parameter. To do it, I've created a parameter, which is a IGPValueTableType. The ValueTable has one column of DEFileType.
As a result, I have a table, with the file browser above, when I can choose multiple files- and those are added to the table. I need to have the file browser filtered for a specific files types (by extension). To do it, I've created a domain, which is a IGPFileDomain, and I've set the file extension with domain.AddType("myext").

The issue I have is - the domain works perfectly with a simple file browser parameter. It does not work for IGPValueTableType parameter.

The code I've used for it looks like this:
        public ESRI.ArcGIS.esriSystem.IArray ParameterInfo
        {
            get
            {
                ...

                // DataType and value.
                IGPValueTableType valueTableType = new GPValueTableTypeClass();
                IGPValueTable valueTable = new GPValueTableClass();
                
                DEFileType inputFileType = new DEFileTypeClass();
                valueTableType.AddDataType((IGPDataType)inputFileType, "Filename(s)", 75, null);
                valueTable.AddDataType((IGPDataType)inputFileType);

                // Set the table as an input parameter.
                IGPParameterEdit3 inParameter = new GPParameterClass();
                inParameter.DataType = (IGPDataType)valueTableType;
                inParameter.Value = (IGPValue)valueTable;
                inParameter.ParameterType = esriGPParameterType.esriGPParameterTypeRequired;
                inParameter.Name = "table";
                inParameter.DisplayName = "Choose File";
                IGPFileDomain domain = new GPFileDomainClass();
                domain.AddType("myext");
                inParameter.Domain = (IGPDomain)domain;
                parameters.Add(inParameter);

                ...

                return parameters;
            }
        }



Anyone have an idea how to make it work for the value table?

thanks!
Luke
0 Kudos
2 Replies
NobbirAhmed
Esri Regular Contributor
Hi Luke,

I'm not sure whether you can filter a particular type (extension) of files through IGPFileDomain 😞 I'm away this week - hope to give you a definitive answer next week.

Meanwhile, you can post your question to ArcGIS > Products > ArcObjects > All Development Languages forum also.

Thanks, Nobbir
Esri Geoprocessing Team.
0 Kudos
LukaszBarcik
New Contributor
Nobbir,

I'm sure it works well for a simple file browser parameter - I've done this already - see the code below. The issue I have is a table view. I will post the question as you mentioned it.


                inParameter = new GPParameterClass();
                inParameter.DataType = (IGPDataType)new DEFileTypeClass();
                inParameter.Value = (IGPValue)new DEFileClass();
                IGPFileDomain domain = new GPFileDomainClass();
                domain.AddType("myext");
                inParameter.Domain = (IGPDomain)domain;
                inParameter.ParameterType = esriGPParameterType.esriGPParameterTypeRequired;
                inParameter.Direction = esriGPParameterDirection.esriGPParameterDirectionInput;
                inParameter.Name = "aBrowser";
                inParameter.DisplayName = "A Browser...";
                parameters.Add(inParameter);


thanks!
Luke

Hi Luke,

I'm not sure whether you can filter a particular type (extension) of files through IGPFileDomain 😞 I'm away this week - hope to give you a definitive answer next week.

Meanwhile, you can post your question to ArcGIS > Products > ArcObjects > All Development Languages forum also.

Thanks, Nobbir
Esri Geoprocessing Team.
0 Kudos