CadPaper
from OpenCAD2D import CadPaper
class CadPaper(System.Object) · CadPaper in the .NET reference
A sheet of paper a plot is laid on, as the Paper size list of AutoCAD's Plot dialog offers it: its name, its size in millimetres as the name gives it, width then height, and the margins its plotter cannot print in. ISO A3 is 420 by 297 with margins of 5 all round, a printable area of 410 by 287.
Constructors
__init__
def __init__(
self,
name: str,
width: float,
height: float,
marginLeft: float,
marginBottom: float,
marginRight: float,
marginTop: float,
) -> None
Makes a sheet.
Properties and fields
MaxPixels
MaxPixels: ClassVar[int]
The most pixels a side of an image may have: 8 000.
MinPixels
MinPixels: ClassVar[int]
The fewest pixels a side of an image may have: 16.
CanonicalName
@property
def CanonicalName(self) -> str
Gets the name as a DXF keeps it in a layout's group 4, AutoCAD's CanonicalMediaName: the name's spaces as underscores, then the size, ISO_A3_(420.00_x_297.00_MM). An image is named the same way, 1920_x_1080_Pixels_(1920.00_x_1080.00_MM), the DXF layer taking a name that ends in a size alone; the layout keeps its units as pixels (group 72 = 2), which CadPlotSettings.Read reads back as the image's size.
CustomPixelsChoice
CustomPixelsChoice: ClassVar[CadPaper]
Gets the last entry of the Paper size list of a raster device, "Custom…", which asks for a width and a height; it is no size to plot on.
Default
Default: ClassVar[CadPaper]
Gets the sheet of a plot when nothing else is given: ISO A3.
DefaultPixels
DefaultPixels: ClassVar[CadPaper]
Gets the size of an image a raster device starts on: 1920 by 1080 pixels, Full HD.
Height
@property
def Height(self) -> float
Gets the height in millimetres: 297 for ISO A3.
IsCustomChoice
@property
def IsCustomChoice(self) -> bool
Gets whether this is CadPaper.CustomPixelsChoice.
IsPixels
@property
def IsPixels(self) -> bool
Gets whether this is the size of an image for the raster devices, OpenCAD2D PNG and JPG: its width and height are then pixels rather than millimetres, and it has no margins, the whole image being printable.
Label
@property
def Label(self) -> str
Gets the name as the Paper size list shows it: ISO A3 (420.00 x 297.00 MM), or for an image 1920 x 1080 Pixels (Full HD).
MarginBottom
@property
def MarginBottom(self) -> float
Gets the margin at the bottom, in millimetres.
MarginLeft
@property
def MarginLeft(self) -> float
Gets the margin at the left of the sheet as named, in millimetres.
MarginRight
@property
def MarginRight(self) -> float
Gets the margin at the right, in millimetres.
MarginTop
@property
def MarginTop(self) -> float
Gets the margin at the top, in millimetres.
Name
@property
def Name(self) -> str
Gets the name shown, as "ISO A3", or for an image "1920 x 1080 Pixels".
PixelSizes
PixelSizes: ClassVar[System.Collections.Generic.IReadOnlyList[CadPaper]]
Gets the sizes of an image the raster devices offer, in the order of the list: 1280 by 720 (HD), 1600 by 1200 (UXGA), 1920 by 1080 (Full HD), 2560 by 1440 (QHD) and 3840 by 2160 (4K UHD).
Standard
Standard: ClassVar[System.Collections.Generic.IReadOnlyList[CadPaper]]
Gets the sheets the built-in PDF plotter offers, in the order of the list: ISO A0 to A4 (1 189 by 841 to 297 by 210) and ANSI A to E (279.4 by 215.9 to 1 117.6 by 863.6), each on its side, with margins of 5 all round.
Width
@property
def Width(self) -> float
Gets the width in millimetres, as the name gives it: 420 for ISO A3.
Methods
IsSameAs
def IsSameAs(self, other: CadPaper) -> bool
Gets whether another sheet is this one: the same name, letters of either case the same, and the same size and margins to a thousandth of a millimetre.
Pixels
@staticmethod
def Pixels(width: int, height: int) -> CadPaper
Makes a size of an image of the user's own, as Custom Image Size makes it: 2480 x 1754 Pixels (Custom).
ToString
def ToString(self) -> str