The Autodesk.Revit.DB.PaperSize
class represents a paper size for printing or plotting views in a Revit document. It is part of the Autodesk.Revit.DB
namespace and is used in conjunction with the Autodesk.Revit.DB.ViewSheet
class.
To use Autodesk.Revit.DB.PaperSize
, you will typically create a new instance of the class with a specified name, width, and height. You can then use this paper size when creating a new Autodesk.Revit.DB.ViewSheet
or editing an existing one.
// Create a new paper size
Autodesk.Revit.DB.PaperSize myPaperSize = new Autodesk.Revit.DB.PaperSize("My Paper Size", 210, 297);
// Create a new ViewSheet using the paper size
Autodesk.Revit.DB.ViewSheet myViewSheet = Autodesk.Revit.DB.ViewSheet.Create(document, myPaperSize.Id);
You can also retrieve a list of all available paper sizes in the Revit document by using the Autodesk.Revit.DB.PrintManager.PaperSizes
property.
// Get a list of all paper sizes in the Revit document
List<Autodesk.Revit.DB.PaperSize> allPaperSizes = document.PrintManager.PaperSizes.ToList();
The Autodesk.Revit.DB.PaperSize
class represents a physical paper size, not a view scale or viewport scale. When creating a new Autodesk.Revit.DB.ViewSheet
, you will still need to set the scale of your view or viewport separately.
Autodesk.Revit.DB.ViewSheet
Autodesk.Revit.DB.PrintManager