Problem: 通过编程选择要素后无法旋转要素
文章编号 : 27391
软件: ArcGIS - ArcEditor 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1 ArcGIS - ArcInfo 8.0.1, 8.0.2, 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcView 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10
操作系统: N/A
软件: ArcGIS - ArcEditor 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1 ArcGIS - ArcInfo 8.0.1, 8.0.2, 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcView 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10
操作系统: N/A
1 个回复
易智瑞技术支持
赞同来自:
原因: ISelectionEvents::SelectionChanged 事件必须在旋转工具完全激活之前触发。编辑器依赖于 SelectionChanged 事件来关联要素选择几何,并且设定选择锚点。如果此事件没有被激活,就没有关联几何用于旋转,也不会产生锚点位置。
解决方法: 下面是示例代码,演示了如何触发 ISelectionEvents::SelectionChanged 事件。 Sub SelectionChanged() Dim pDoc As IMxDocument Dim pMap As IMap Dim pLayer As IFeatureLayer Dim pFc As IFeatureClass Dim pSelSet As ISelectionSet Dim pFSel As IFeatureSelection Dim pSelEvents As ISelectionEvents Set pDoc = ThisDocument Set pMap = pDoc.FocusMap Set pLayer = pMap.Layer(0) Set pFc = pLayer.FeatureClass 'Get the selection set Set pSelSet = pFc.Select(Nothing, 1, 1, Nothing) 'Update the layer with the seletion set Set pFSel = pLayer Set pFSel.SelectionSet = pSelSet 'Fire SelectionChanged event Set pSelEvents = pMap pSelEvents.SelectionChanged 'Refresh pDoc.ActiveView.Refresh End Sub
创建时间:2004-08-04
最近更新: 2011-09-08
【原文链接】
http://support.esrichina.com.c ... .html
要回复问题请先登录或注册