VBA Code from ArcMap for ArcScene

Discussion created by cyberborsty on Jul 24, 2010
Latest reply on Jul 28, 2010 by jbarry-esristaff

I have written an example for ArcMap which configures the Definition Expression. Problem is that the code doesn't work so in ArcScene. I know the that MxDocument in ArcScene is called SxDocument but for the ActiveView.Refresh what is existing in ArcMap, I don't find the correct complement in ArcScene.
Can somebody help me, please?

I publish the ArcMap Code, which is working correctly.

Dim pMxDocument As IMxDocument
Set pMxDocument = Application.Document
Dim pLayer As ILayer
Set pLayer = pMxDocument.SelectedLayer

If Not TypeOf pLayer Is IFeatureLayer Then
MsgBox "No Featurelayer chosen!", vbCritical, "abort"
Exit Sub   
End If

Dim pFDef As IFeatureLayerDefinition
Set pFDef = pLayer
pFDef.DefinitionExpression = "[tbyear] <1959 or ([tbyear] = 1959 And [tbmon] < 8)or([tbyear] =1959 and [tbmon] =8 and [tbday] <= 31)"