组件端的相关接口是SpatialQuery(geometry3D, recordset, positionMode);
示例:
private void button1_Click(object sender, EventArgs e) { Selection3D[] s3ds = scene.FindSelection(true); Recordset rs = s3ds[0].ToRecordset(); Geometry3D g3d = rs.GetGeometry() as Geometry3D; Layer3DDataset l3d = scene.Layers["Building_1@CBD"] as Layer3DDataset; Recordset rs2 = (l3d.Dataset as DatasetVector).GetRecordset(false, CursorType.Dynamic); List<int> list = SuperMap.Realspace.ThreeDDesigner.SpatialQuery3D.SpatialQuery(g3d, rs2, PositionMode.IntersectsOrContains); }
需要注意的是,空间查询的查询对象必须是闭合模型,被查询对象可以不用。