salvador37

ExportCAD tool - in_features field

Discussion created by salvador37 on Aug 11, 2011
Latest reply on Aug 16, 2011 by salvador37
Hi all

I'm trying to export some features do CAD using C#. When I set the in_features field with an absolut path, like "C:\temp.shp" or "C:\geodatabase.sde\DB.layer\DB.sublayer", it works fine. But if I try to set as a reference, like the following code, it doesn't export anything (but doesn't throw exceptions either):

        List<IFeatureClass> lFeatClass = null;
        IFeatureClass pFeatClass = null;
        FeatureClass pFeatureClass = null;
        //IFeatureLayer pFeatLayer;         
 
          lFeatClass = this.getAllFeatureClasses(); 
          //pFeatLayer = new FeatureLayerClass();
          for (int iFeat = 0; iFeat < lFeatClass.Count; iFeat++)
          {
             pFeatClass = lFeatClass[iFeat];
             pFeatureClass = (FeatureClass)pFeatClass;

             //pExportCAD.in_features = pFeatClass;
             pExportCAD.in_features = pFeatureClass; // this field which I'm asking for help

             strOutFile = strOutFile.Split('.')[0] + "_" + lFeatClass[iFeat].AliasName.ToUpper() + "." + strOutFile.Split('.')[1];
             pExportCAD.Output_File = strOutFile;
             pExportCAD.Output_Type = strOutType; 

             if (pGP.Exists(pExportCAD.in_features, ref obj))
             {
               pResults = (IGeoProcessorResult)pGP.Execute(pExportCAD, null);
             }
         }



Does anyone know why can't I pass the Feature Class, or even the Feature Layer, as reference? Does it work if I set a .gdb as input, instead of feature class?

Thanks in advance

Outcomes