View3DGetRenderingSettings Method |
Returns the current rendering settings for this 3d view.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.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>();
}
See Also