使用产品:iObject java 11.0.1
数据类型: BIM模型
问题:java代码使用SceneCacheBuilder生成缓存后,缓存生成成功,但是接下来layer3SDs.add()方法报错,代码如下
Datasource datasource = datasources.get(i);
Dataset dataset = datasource.getDatasets().get(0);
boolean datasetOpen = dataset.open();
log.info("打开数据集");
SceneCacheBuilder cacheBuilder = new SceneCacheBuilder();
cacheBuilder.setStorageType(StorageType.Original);
cacheBuilder.setOutputFolder(bimPath);
cacheBuilder.setOutputSceneName(dataset.getName());
cacheBuilder.setS3MVersion(S3MVersion.VERSION_10);
boolean build = cacheBuilder.build();
log.info("生成切片缓存"+build);
Scene scene = new Scene(workspace);
Layer3Ds layers = scene.getLayers();
String cachePath =
bimPath+File.separator+dataset.getName()+File.separator+dataset.getName()+".scp";
Layer3D add = layers.add(cachePath, Layer3DType.MODEL, true);
add.setEditable(true);
add.setVisible(true);
scene.ensureVisible(add);
//添加缓存
log.info("添加缓存");
Scenes scenes = workspace.getScenes();
scenes.add(dataset.getName(), scene.toXML());
报错如下