使用产品:iobject for java 10.2.1-20428-92245 操作系统:win11 x64
数据类型:文件型工作空间
问题详细描述:参考api文档使用iobject for java实现从文件型工作空间导出数据集为dwg格式文件时失败,在idea debug模式可以看到数据集是可以正常通过getAllFeatures()方法拿到要素集合的,目前不清楚是参数配置的问题还是数据集的类型不匹配导致的失败,debug截图如下:
public static void exportToDWG(){
try {
ExportSettingDWG exportSettingDWG = new ExportSettingDWG();
exportSettingDWG.setOverwrite(true);
exportSettingDWG.setTargetFileCharset(Charset.UTF8);
exportSettingDWG.setTargetFilePath("D:" + File.separator);
exportSettingDWG.setSourceData(dataset); //dataset为DatasetVector类型
exportSettingDWG.setExportingExternalData(true);
exportSettingDWG.setExportingXRecord(true);
exportSettingDWG.setExportingBorder(true);
DataExport dataExport = new DataExport();
ExportSettings exportSettings = dataExport.getExportSettings();
exportSettings.add(exportSettingDWG);
dataExport.setExportSettings(exportSettings);
ExportResult exportResult = dataExport.run();
dataExport.dispose();
dataset.close();
}catch (Exception e){
dataset.close();
datasource.close();
workspace.close();
workspace.dispose();
}
}