The settings object provides access to general components of the Autodesk Revit
application, such as Categories.
Inheritance Hierarchy
System.ObjectAutodesk.Revit.DB.APIObject
Autodesk.Revit.DB.Settings
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.1.0.0 (26.1.0.34)
Syntax
C#
public class Settings : APIObject
The Settings type exposes the following members.
Properties
Name | Description | |
---|---|---|
![]() | Categories | Retrieves an object that provides access to all the categories contained in the Autodesk Revit application and project. |
![]() | ElectricalSetting | Retrieves an object that provides access to all the electrical settings include voltage type, distribution system type, demand factor, wire type in the Autodesk Revit application and project. |
![]() ![]() | IsReadOnly | Identifies if the object is read-only or modifiable. (Inherited from APIObject) |
![]() | TilePatterns | Retrieves an object that provides access to the TilePattern objects in the document. |
Methods
Name | Description | |
---|---|---|
![]() | Dispose | Causes the object to release immediately any resources it may be utilizing. (Inherited from APIObject) |
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object) |
Example
C#
// Get some of the settings information, including categories and FillPatterns Settings settings = document.Settings; // Format the prompt information string String prompt = "Setting information: "; prompt += "\nNumber of Categories: " + settings.Categories.Size; FilteredElementCollector fillPatternCollector = new FilteredElementCollector(document); prompt += "\nNumber of Fill Patterns: " + fillPatternCollector.OfClass(typeof(FillPatternElement)).Count(); FilteredElementCollector linePatternCollector = new FilteredElementCollector(document); prompt += "\nNumber of Line Patterns: " + linePatternCollector.OfClass(typeof(LinePatternElement)).Count(); // Give the user some information TaskDialog.Show("Revit",prompt);
VB
' Get some of the settings information, including categories and FillPatterns Dim settings As Settings = document.Settings ' Format the prompt information string Dim prompt As [String] = "Setting information: " prompt += vbLf & "Number of Categories: " + settings.Categories.Size Dim fillPatternCollector As New FilteredElementCollector(document) prompt += vbLf & "Number of Fill Patterns: " & fillPatternCollector.OfClass(GetType(FillPatternElement)).Count() Dim linePatternCollector As New FilteredElementCollector(document) prompt += vbLf & "Number of Line Patterns: " & linePatternCollector.OfClass(GetType(LinePatternElement)).Count() ' Give the user some information TaskDialog.Show("Revit", prompt)