gisempire100
捉鬼专家
捉鬼专家
  • 注册日期2004-08-13
  • 发帖数552
  • QQ
  • 铜币2462枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:914回复:0

单个图层分级显示的思路型代码

楼主#
更多 发布于:2008-01-04 17:28
<P>在VBA中调试成功,稍作修改可以用于复杂网络的分级显示,呵呵
<P>Dim WithEvents pp As Map<BR>Dim tt As IMap<BR>Dim str As String<BR>Dim pFLDef As IFeatureLayerDefinition
<P><BR>Private Sub pp_ViewRefreshed(ByVal view As esriCarto.IActiveView, ByVal phase As esriCarto.esriViewDrawPhase, ByVal data As Variant, ByVal envelope As esriGeometry.IEnvelope)<BR>    str = """等级路面-ID"" >" ; Int(tt.MapScale / 800)<BR>    pFLDef.DefinitionExpression = str<BR>    Debug.Print "View: "; str<BR>End Sub</P>
<P>Sub main()<BR>    Dim md As IMxDocument<BR>    Set md = ThisDocument<BR>    Set pp = md.FocusMap<BR>    Set tt = pp<BR>    Dim pFLayer As IFeatureLayer<BR>    Set pFLayer = tt.Layer(2)<BR>    ' Set the definition query of the layer<BR>    Set pFLDef = pFLayer<BR>    ' QI from the FeatureLayer<BR>    ' set the definition expression  pMxDoc.ActiveView.Refresh<BR>End Sub</P><BR>
喜欢0 评分0
A friend is never known till a man has need. ...CL
游客

返回顶部