好久没有写博文了,这段时间相对空闲一点,把AE数据编辑实现总结下。
要编辑要素,首先要选中要素,按shift键进行多选,按esc键清空选择。
个人了解的选择高亮显示有两种方式,都是在public override void OnMouseDown(int Button, int Shift, int X, int Y)事件中处理实现:
1、 IFeatureSelection 这个要求明确选择的图层
IPoint pPoint = pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); IEnvelope pEnvelope; double tol = 20; pEnvelope = pPoint.Envelope; pEnvelope.Width = pEnvelope.Width + tol; pEnvelope.Height = pEnvelope.Height + tol; pEnvelope.CenterAt(pPoint); ISpatialFilter pSpatialFilter; pSpatialFilter = new SpatialFilterClass(); pSpatialFilter.Geometry = pEnvelope; pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects; IFeatureSelection pFeatureSelection; pFeatureSelection = ucDrawPanel.currentFeatureLayer as IFeatureSelection; IFeature pFeature; ucDrawPanel.unionFeature = new List<IFeature>();//实例化合并要素集