count the rows from layer have "Page Definition Query" activated

522
2
12-05-2012 09:30 AM
DavixKm
New Contributor
how i can calculate the rows from a layer have "Page Definition Query" activated?
i need the total of rows when the "Page Definition Query" is active and not the real total from the layer.

i try with this code but dont work like i want, because this get all record the layer have.
     Dim pdoc As IMxDocument
    Dim pmap As IMap
    Dim pfi As IFeatureLayer
    Dim pfc As IFeatureClass
    
    Set pdoc = ThisDocument
    Set pmap = pdoc.activeView.FocusMap
    Set pfi = pmap.Layer(1)
    Set pfc = pfi.FeatureClass
    
    MsgBox (" features: " & pfc.FeatureCount(Nothing))

cheers.
0 Kudos
2 Replies
JimBarry
Esri Regular Contributor
moving to ArcObjects forum.  -jb
0 Kudos
JeffMatson
Occasional Contributor III
I haven't used data driven pages but assuming the definition query works the same, you will want to search using IFeatureLayer instead of IFeatureClass:

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Search_Method/0012000004...


how i can calculate the rows from a layer have "Page Definition Query" activated?
i need the total of rows when the "Page Definition Query" is active and not the real total from the layer.

i try with this code but dont work like i want, because this get all record the layer have.
     Dim pdoc As IMxDocument
    Dim pmap As IMap
    Dim pfi As IFeatureLayer
    Dim pfc As IFeatureClass
    
    Set pdoc = ThisDocument
    Set pmap = pdoc.activeView.FocusMap
    Set pfi = pmap.Layer(1)
    Set pfc = pfi.FeatureClass
    
    MsgBox (" features: " & pfc.FeatureCount(Nothing))

cheers.
0 Kudos