首页 / 浏览问题 / 组件GIS / 问题详情
使模型变成选中状态
11EXP 2019年07月15日
通过代码让一个模型的状态变成选中状态。

1个回答

您好,可以通过实例化Selection3D,然后通过Selection3D.Add模型对象的Smid值来实现
2,432EXP 2019年07月15日
Recordset RS = dtv.Query(""+ XmlVale + "='"+ textBox1.Text + "'", CursorType.Static);
                    Geometry geo = RS.GetGeometry();                    
                    Point2D poin = geo.InnerPoint;
                    SceneControl sceneControl = (SuperMap.Desktop.Application.ActiveForm as IFormScene).SceneControl;
                    sceneControl.Scene.Camera = new SuperMap.Realspace.Camera(poin.X,poin.Y,30);
                    sceneControl.IsDynamicSelection = true;
                    sceneControl.Scene.Refresh();
                    Selection3D selection = new Selection3D();
                    GeoStyle3D geostyle = new GeoStyle3D();
                    geostyle.FillForeColor = Color.Red;
                    selection.Style = geostyle;//选中时风格
                    selection.Add(RS.GetID());
                    RS.Dispose();

模型没有选中,帮忙看看是不是代码错了
您好,我这边说的有点问题,不是实例化,是直接获取当前图层的选择集

          Selection3D selection3d = sceneControl1.Scene.Layers[0].Selection;
          selection3d.Add(1);
          selection3d.Style.FillForeColor = Color.Red;
          selection3d.UpdateData();//此项为必填
可以了谢谢
...