I have code that will hide a certain set of points from the view using an ExclusionSet, and then switch to layout view for printing.

I noticed in my 9.1 version, when after I am done printing, and I switch back to data view, and the points I had before running the code are shown. This was my intention.

In 10 on the other hand, the code runs the same, but when I return to data view, the feature exclusions are still in-tact. I have to manually remove them via the display properties of the feature layer.

Is there anyway to have separate properties for both views? Whether it be code or manual?


  • What type of code are you using?
    – PolyGeo
    Commented Jan 9, 2013 at 22:37
  • I am using ArcObjects (VB.NET) Commented Jan 9, 2013 at 23:56
  • ArcGIS 9.1 is a Retired version so I removed its tag from this question.
    – PolyGeo
    Commented Apr 25, 2013 at 10:14

2 Answers 2


Why not just toggle a definition query based on if you are in data or layout view, see example of definition query below:

' Set the definition query of the layer
  Dim pFLDef As IFeatureLayerDefinition
  Set pFLDef = pFLayer               ' QI from the FeatureLayer
  pFLDef.DefinitionExpression = "SUB_REGION = 'Pacific'"    ' set the definition expression

You can change between views like:

Public Sub ToggleActiveView()
  Dim pMxDoc As IMxDocument
  Set pMxDoc = Application.Document
  If TypeOf pMxDoc.ActiveView Is IPageLayout Then
    Set pMxDoc.ActiveView = pMxDoc.FocusMap
    Set pMxDoc.ActiveView = pMxDoc.PageLayout
  End If
End Sub
  • Totally late reply, but this was a great answer. Just wish it could be tied to an event where I didn't have to create an external button to toggle. Commented Apr 25, 2013 at 16:22

May be you can see IMxDocument.ActiveView Property. Active view gives different objects based on layout view and data view. So you might be able to set properties based on the view.[Though it is in C#.net. There must be something like this in vb.net]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.