IExportContextOnViewBegin Method |
This method marks the beginning of a 3D view to be exported.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
SyntaxRenderNodeAction OnViewBegin(
ViewNode node
)
Function OnViewBegin (
node As ViewNode
) As RenderNodeAction
RenderNodeAction OnViewBegin(
ViewNode^ node
)
abstract OnViewBegin :
node : ViewNode -> RenderNodeAction
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
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)
{
}
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
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also