下面代码只是实现了,单选二维路段ID 后,三维相应路段高亮显示,如何实现多选二维路段,对应三维高亮显示?
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 B = Convert.ToInt32(C);
if (B == 1)
{
for (int i = 0; i < 57; i++)
{
int[] X = { B + i };
Layer3DDataset layer3DDataset = m_sceneControl.Scene.Layers[0] as Layer3DDataset;
Selection3D selection3D = layer3DDataset.Selection;
selection3D.AddRange(X);
layer3DDataset.Selection.UpdateData();
}
}
else if (B == 2)
{
for (int i = 0; i < 57; i++)
{
int[] X = { B + i };
Layer3DDataset layer3DDataset = m_sceneControl.Scene.Layers[0] as Layer3DDataset;
Selection3D selection3D = layer3DDataset.Selection;
selection3D.AddRange(X);
layer3DDataset.Selection.UpdateData();
}
}
}
}
catch (Exception ex)
{
Trace.WriteLine(ex.Message);
}
}