Export XFM features as shapefiles

I am working on a C# addin, which among other formats, must be able to export Esri Shape files and MapinfoTAB files. For now I have got it working sending keyins, but I would like to use the Bentley.Geospatial.DataInterchange API.

I have looked in the GeoDataInterchangeAPI. chm help file, but I as fare as I can see, the help file don't match the API, as I see it referenced from Visual Studio.

Can anyone help me with an example, or some code snippets?

/Peter

Parents
  • Hi Jeff

    Thanks for your reply, I think i have found a solution. I have come up with the following code, that seems to do what i need at the moment.

    GDIExplorerExportNode ExpNode = new GDIExplorerExportNode("Eksport");

    ExpNode.AddExportDirectory(GDIExplorerExportNode.FileCreateType.SHP, @"c:\temp\shp");

    IStorageImportCriteria StorImpCrit = ExpNode.StorageImports[0];

     

    foreach (IClassImportCriteria currentClassImp in StorImpCrit.ClassImports.Values)

    {

    if (currentClassImp.Name == "Ledninger") currentClassImp.Selected = true;

    else currentClassImp.Selected = false;

    }

    if (RadFence.Checked)  ExpNode.SpatialArea = SpatialArea.Fence;

    else if (RadSelection.Checked)  ExpNode.SpatialArea = SpatialArea.Selection;

    else if (RadView.Checked)  ExpNode.SpatialArea = SpatialArea.View;

    else ExpNode.SpatialArea = SpatialArea.All;

     

    GDIImportProcessor importProcessor = new GDIImportProcessor();

    importProcessor.IsExport = true;

    importProcessor.Import(ExpNode, StorImpCrit);

Reply
  • Hi Jeff

    Thanks for your reply, I think i have found a solution. I have come up with the following code, that seems to do what i need at the moment.

    GDIExplorerExportNode ExpNode = new GDIExplorerExportNode("Eksport");

    ExpNode.AddExportDirectory(GDIExplorerExportNode.FileCreateType.SHP, @"c:\temp\shp");

    IStorageImportCriteria StorImpCrit = ExpNode.StorageImports[0];

     

    foreach (IClassImportCriteria currentClassImp in StorImpCrit.ClassImports.Values)

    {

    if (currentClassImp.Name == "Ledninger") currentClassImp.Selected = true;

    else currentClassImp.Selected = false;

    }

    if (RadFence.Checked)  ExpNode.SpatialArea = SpatialArea.Fence;

    else if (RadSelection.Checked)  ExpNode.SpatialArea = SpatialArea.Selection;

    else if (RadView.Checked)  ExpNode.SpatialArea = SpatialArea.View;

    else ExpNode.SpatialArea = SpatialArea.All;

     

    GDIImportProcessor importProcessor = new GDIImportProcessor();

    importProcessor.IsExport = true;

    importProcessor.Import(ExpNode, StorImpCrit);

Children
No Data