使用产品:iserver 9D 操作系统:win10 x64 数据类型:文件型 问题详细描述:对模型进行截面投影时,报出参数不允许为null,接口仅支持直角坐标系 问题重现步骤: 1.获取模型,2、调用ModelBuilder3D.SectionProjection(newGeoModel3D) 这一步就报错
老师你好,1、我这里做投影面,用ModelBuilder3D.PlaneProjection(geoModel3D)时会报这个错误
2、另外如果用Layer3D.SetCustomClipPlane时这个就对图层中的所有模型进行了剖切,看到有ModelBuilder3D.SectionProjection(geoModel3D) 可以对单个模型进行截面,就进行测试,发现也是会报这个错误。
下面是我的代码,麻烦老师看看是否有问题
private void SceneControl_ObjectSelectChanged(object sender, ObjectSelectChangedEventArgs e) { Recordset recordset = null; Selection3D[] selection3Ds = null; try { if (e.Count > 0) { selection3Ds = m_sceneControl.Scene.FindSelection(true); if (selection3Ds.Length > 0) { recordset = selection3Ds[0].ToRecordset(); if (recordset != null) { highLightRecord(selection3Ds[0]); Geometry geometry = recordset.GetGeometry(); if (geometry.Type == GeometryType.GeoModel3D) { GeoModel3D geoModel3D = geometry as GeoModel3D; if (geoModel3D != null) { GeoRegion geoRegion = ModelBuilder3D.PlaneProjection(geoModel3D); if (geoRegion != null) { //AddRegionRecord(selectDataset, geoRegion); } } } } } } } catch (Exception ex) { Trace.Write(ex.Message); } finally { if (recordset != null) { recordset.Close(); recordset.Dispose(); } } }
老师你好,这里highLightRecord是换一种显示颜色,我屏蔽这一句再测试还是一样的问题
private void highLightRecord(Selection3D selection3D) { if (selection3D != null) { selection3D.Style.FillForeColor = Color.FromArgb(99, Color.Red); } }