您好,我这边用自己的数据测试没有问题,以下是我的测试代码:
Workspace workspace = new Workspace();
WorkspaceConnectionInfo info = new WorkspaceConnectionInfo();
info.setServer("E:\\测试目录\\0818\\grid_test.smwu");
info.setType(WorkspaceType.SMWU);
workspace.open(info);
Datasource datasource = workspace.getDatasources().get(1);
DatasetVector dataset = (DatasetVector) datasource.getDatasets().get(0);
ExportSettingDWG setting = new ExportSettingDWG();
setting.setTargetFilePath("E:\\测试目录\\test22222.dwg");
setting.setSourceData(dataset);
setting.setTargetFileType(FileType.DWG);
setting.setOverwrite(true);
setting.setTargetFileCharset(Charset.UTF8);
setting.setVersion(CADVersion.CAD2000);
setting.setExportingBorder(true);
ExportSettings settings = new ExportSettings();
settings.add(setting);
DataExport dataexport = new DataExport();
dataexport.setExportSettings(settings);
ExportResult result = dataexport.run();
System.out.println(result.getSucceedSettings().length);
方便的话可以把数据发给我 我这边测试一下