|
阅读:914回复:0
单个图层分级显示的思路型代码
<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> |
|
|