Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

Using DEWorkspaceType as ouput parameter in GP tools

$
0
0
I got a tool that supports writing to various feature workspaces (Shape, GDB and SDE). The user selects the desired workspace, and the tool creates feature classes. The ouput parameter is declared like this:

Code:

IGPParameterEdit3 parameter = new GPParameterClass();
parameter.Name = "out_workspace";
parameter.DisplayName = "Output workspace";
parameter.ParameterType = esriGPParameterType.esriGPParameterTypeRequired;
parameter.Direction = esriGPParameterDirection.esriGPParameterDirectionOutput;
parameter.DataType = new DEWorkspaceTypeClass();
parameter.Value = new DEWorkspaceClass();

This works fine for shape folders and file geodatabases. However, when I select an .sde file as workspace, the tool changes the file extension to .gdb (in the GUI, not on disk).

For example, when selecting "C:\somewhere\myfile.sde", it is shown as "C:\somewhere\myfile.gdb". The tool will of course fail.

However, when dragging the .sde file from the catalog tree to the tool, it shows correct file extension.


I am using ArcObjects/ArcGis 10.0 SP5.

Viewing all articles
Browse latest Browse all 1374

Trending Articles