|Layer 3D Properties
To control any of the properties for a layer that are found on the Base Heights,
Extrusion, or Rendering tabs of the layer property sheet in ArcScene, you can use the
I3DProperties interface which is implemented by several co-classes associated with the layer: Basic3DProperties, Feature3DProperties, Raster3DProperties, and Tin3DProperties.
These are known as layer extensions.
How to use:
Add a feature layer to ArcScene.
Paste the code into ArcScene's VB Editor.
Run the procedure.
Public Sub AccessLayer3DProperties()
' in ArcScene VBA...
' get the document
Set pSxDoc = Application.Document
' get the Scene from the Document:
Set pScene = pSxDoc.Scene
' get a layer in the scene (assumes there is one)
Set pLayer = pScene.Layer(0)
' get layer extensions:
Set pLayerExts = pLayer
' get 3d properties from extension:
' layer must have it if it is in scene:
For i = 0
To pLayerExts.ExtensionCount - 1
If TypeOf pLayerExts.Extension(i)
Set p3DProps = pLayerExts.Extension(i)
' set the layer's base height property to an expression
' that equals an item multiplied by a constant.
' This case assumes we have a feature layer with an item
' called [HEIGHT]
p3DProps.BaseOption = esriBaseExpression
p3DProps.BaseExpressionString = "[HEIGHT] * 3.28 "
' Tell the scene graph to invalidate the layer and redraw:
Set pSG = pScene.SceneGraph