#Autodesk.Revit.DB.ViewSheetSetting
The Autodesk.Revit.DB.ViewSheetSetting is a class in the Revit API that represents a view sheet setting. This setting defines how a view is displayed on a sheet.
The ViewSheetSetting class has the following properties:
Viewport - Gets or sets the viewport for the sheet.
Origin - Gets or sets the origin of the view on the sheet.
Scale - Gets or sets the scale of the view.
Detail number - Gets or sets the detail number of the view.
The ViewSheetSetting class has the following methods:
GetViewportBox() - Returns the bounding box of the viewport.
SetViewportBox(BoundingBoxXYZ) - Sets the bounding box of the viewport.
IsValidDetailNumber(String) - Returns true if the given string is a valid detail number.
GetValidDetailNumberPattern() - Returns the regular expression pattern for a valid detail number.
SetToDefault() - Sets the view sheet setting to its default state.
The ViewSheetSetting class is used in conjunction with the SheetView class to represent the settings for a view on a sheet.
The following example demonstrates how to create a new ViewSheetSetting and set its properties:
ViewSheetSetting vss = new ViewSheetSetting();
vss.Viewport = new XYZ(0, 0, 0);
vss.Origin = new XYZ(1, 1, 0);
vss.Scale = 100;
vss.DetailNumber = "1";
SheetView sv = new SheetView();
sv.SetViewSheetSetting(vss);
In this example, a new ViewSheetSetting is created and its properties are set. The ViewSheetSetting is then passed to a SheetView using the SetViewSheetSetting method.
The Autodesk.Revit.DB.ViewSheetSetting class is a useful tool for managing the appearance of views on sheets in Revit. Its properties and methods provide a powerful set of options for customizing the display of views.