选择二维路段ID后对应路段三维高亮显示问题,三维路段未高亮显示。是不是Layer3DDataset layer3DDataset = m_sceneControl.Scene.Layers[4] as Layer3DDataset; 图层选择有问题?
private void mapControllian_GeometrySelected(object sender, GeometrySelectedEventArgs e)
{
try
{
Selection[] selection = mapControllian.Map.FindSelection(true);
if (selection != null && selection.Length != 0)
{
Recordset recordset = selection[0].ToRecordset();
object A = recordset.GetObject("ID");
C = A.ToString();
int x=Convert.ToInt32(C);
Layer3DDataset layer3DDataset = m_sceneControl.Scene.Layers[4] as Layer3DDataset;
Selection3D selection3D = layer3DDataset.Selection;
selection3D.Add(x);
layer3DDataset.Selection.UpdateData();
}
}
catch (Exception ex)
{
Trace.WriteLine(ex.Message);
}
}