Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question
What type of code are you using? – PolyGeo Jan 9 '13 at 22:37
I am using ArcObjects (VB.NET) – Logan B. Lehman Jan 9 '13 at 23:56
ArcGIS 9.1 is a Retired version so I removed its tag from this question. – PolyGeo Apr 25 '13 at 10:14
up vote 1 down vote accepted

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
share|improve this answer
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. – Logan B. Lehman Apr 25 '13 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 There must be something like this in]

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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