使用产品:idesktop 9d 操作系统:win10 x64
数据类型: skp
问题详细描述:C#二次开发导入skp模型失败,在sceneControl1.Scene.Layers.Add(importResult, layerSetting, true);这句报错,其中importResult为空,其他模型类型,如3ds、osg等均可以。
代码如下:
DataImport m_dataImport;
m_dataImport.ImportSettings.Clear();
ImportSetting modelSetting = new ImportSettingSKP();
modelSetting.SourceFilePath = _3dsimport._3dsImportFileName;
modelSetting.TargetDatasource = workspace1.Datasources[_3dsimport._3dsImportResourseName];
modelSetting.TargetDatasetName = _3dsimport._3dsImportTargetDatasetName;
modelSetting.ImportMode = ImportMode.None;
modelSetting.TargetPrjCoordSys = PrjCoordSys.FromEPSG(_3dsimport._3dsImportProjection);
m_dataImport.ImportSettings.Add(modelSetting);
m_dataImport.Run();
Dataset importResult = workspace1.Datasources[_3dsimport._3dsImportResourseName].Datasets[modelSetting.TargetDatasetName] as Dataset;
Layer3DSettingVector layerSetting = new Layer3DSettingVector();
sceneControl1.Scene.Layers.Clear();
sceneControl1.Scene.Layers.Add(importResult, layerSetting, true);
sceneControl1.Scene.Refresh();