View3DGetRenderingSettings Method |
Returns the current rendering settings for this 3d view.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic RenderingSettings GetRenderingSettings()
Public Function GetRenderingSettings As RenderingSettings
public:
RenderingSettings^ GetRenderingSettings()
member GetRenderingSettings : unit -> RenderingSettings
Return Value
RenderingSettings
The returned object represents the current rendering settings.
If you change the returned object, you need to call SetRenderingSettings to apply the new settings back to Revit.
Examplepublic RenderingSettings GetFirstRenderingSettings(Document document)
{
if (document.IsFamilyDocument)
return null;
List<View3D> theView3Ds = new List<View3D>();
foreach (View3D view3D in RetrieveElementByType<View3D>(document))
{
if (view3D.IsTemplate || !view3D.CanBePrinted)
continue;
return view3D.GetRenderingSettings();
}
return null;
}
public static List<T> RetrieveElementByType<T>(Document document) where T : Autodesk.Revit.DB.Element
{
FilteredElementCollector collector = new FilteredElementCollector(document);
return collector.OfClass(typeof(T)).Cast<T>().ToList<T>();
}
Public Function GetFirstRenderingSettings(document As Document) As RenderingSettings
If document.IsFamilyDocument Then
Return Nothing
End If
Dim theView3Ds As New List(Of View3D)()
For Each view3D As View3D In RetrieveElementByType(Of View3D)(document)
If view3D.IsTemplate OrElse Not view3D.CanBePrinted Then
Continue For
End If
Return view3D.GetRenderingSettings()
Next
Return Nothing
End Function
Public Shared Function RetrieveElementByType(Of T As Autodesk.Revit.DB.Element)(document As Document) As List(Of T)
Dim collector As New FilteredElementCollector(document)
Return collector.OfClass(GetType(T)).Cast(Of T)().ToList()
End Function
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