This method marks the beginning of a 3D view to be exported.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 26.4.0.0 (26.4.0.0)
Syntax
C#
RenderNodeAction OnViewBegin(
ViewNode node
)
Parameters
- node ViewNode
-
Geometry node associated with the view.
Return Value
RenderNodeAction
Return RenderNodeAction.Skip if you wish to skip exporting this view,
or return RenderNodeAction.Proceed otherwise.
Example
C#
public RenderNodeAction OnViewBegin(ViewNode node)
{
View3D theView = m_document.GetElement(node.ViewId) as View3D;
string viewName = theView.Name;
ViewOrientation3D theOrientation = theView.GetOrientation();
CameraInfo camera = node.GetCameraInfo();
bool isPerspective = camera.IsPespective;
RenderingSettings renderSettings = theView.GetRenderingSettings();
BackgroundStyle bkStyle = renderSettings.BackgroundStyle;
SunAndShadowSettings sun = theView.SunAndShadowSettings;
bool needToExportLight =
(renderSettings.LightingSource != LightingSource.ExteriorSun) &&
(renderSettings.LightingSource != LightingSource.InteriorSun);
return RenderNodeAction.Proceed;
}
public void OnViewEnd(ElementId elementId)
{
}
VB
Public Function OnViewBegin(node As ViewNode) As RenderNodeAction Implements IExportContext.OnViewBegin
Dim theView As View3D = TryCast(m_document.GetElement(node.ViewId), View3D)
Dim viewName As String = theView.Name
Dim theOrientation As ViewOrientation3D = theView.GetOrientation()
Dim camera As CameraInfo = node.GetCameraInfo()
Dim isPerspective As Boolean = camera.IsPespective
Dim renderSettings As RenderingSettings = theView.GetRenderingSettings()
Dim bkStyle As BackgroundStyle = renderSettings.BackgroundStyle
Dim sun As SunAndShadowSettings = theView.SunAndShadowSettings
Dim needToExportLight As Boolean = (renderSettings.LightingSource <> LightingSource.ExteriorSun) AndAlso (renderSettings.LightingSource <> LightingSource.InteriorSun)
Return RenderNodeAction.Proceed
End Function
Public Sub OnViewEnd(elementId As ElementId) Implements IExportContext.OnViewEnd
End Sub
See Also
Reference