Dim WithEvents pp As Map
Dim tt As IMap
Dim str As String
Dim pFLDef As IFeatureLayerDefinition
Private Sub pp_ViewRefreshed(ByVal view As esriCarto.IActiveView, ByVal phase As esriCarto.esriViewDrawPhase, ByVal data As Variant, ByVal envelope As esriGeometry.IEnvelope)
str = """等级路面-ID"" >" & Int(tt.MapScale / 800)
pFLDef.DefinitionExpression = str
Debug.Print "View: "; str
End Sub
Sub main()
Dim md As IMxDocument
Set md = ThisDocument
Set pp = md.FocusMap
Set tt = pp
Dim pFLayer As IFeatureLayer
Set pFLayer = tt.Layer(2)
' Set the definition query of the layer
Set pFLDef = pFLayer
' QI from the FeatureLayer
' set the definition expression pMxDoc.ActiveView.Refresh
End Sub