首页 > 代码库 > 定点查询
定点查询
//1.找到要查询的图层
//2.找到要查询的shape
//3设置Camera的位置
//4刷新
ILayer pLayer = axSceneControl1.SceneGraph.Scene.get_Layer(i);
IFeatureLayer pFeatureLayer = pLayer as IFeatureLayer;
IFeatureClass pFeatureClass = pFeatureLayer.FeatureClass;
IFeature pFeature = pFeatureClass.GetFeature(j);
IPoint TargetPoint = pFeature.Shape as IPoint;
IPoint CameraPoint = new PointClass();
CameraPoint.X = TargetPoint.X - 100;
CameraPoint.Y = TargetPoint.Y - 50;
CameraPoint.Z = TargetPoint.Z + 100;
ICamera PCaera = axSceneControl1.SceneViewer.Camera;
PCaera.Target = TargetPoint;
PCaera.Observer = CameraPoint;
//IScene pScene = axSceneControl1.SceneGraph.Scene;
axSceneControl1.SceneGraph.RefreshViewers();