Table of Contents

CadPlotStamp

from OpenCAD2D import CadPlotStamp

class CadPlotStamp(System.Object) · CadPlotStamp in the .NET reference

The plot stamp of AutoCAD's PLOTSTAMP and -PLOTSTAMP: a few lines of text, the name of the drawing, the layout, the date and time, the login name, the plotter, the sheet and the scale, and two fields of the user's own, put in a corner of the sheet of a plot, and the same words kept in a log file. The commands keep one for a session (CadCommandSession.PlotStamp) and hand a copy to the settings of each plot while CadPlotStamp.On (CadPlotSettings.PlotStamp); the PDF writer puts it on the page.

The plot stamp parameter file, AutoCAD's .pss, which the Plot Stamp dialog's Load and Save As read and write: a PIA file, its head "PIAFILEVERSION_2.0,plotstampcompress" and "pmzlibcodec", then the Adler-32 of a zlib stream, the length of the text and of the stream, and the stream of a text of nested blocks, as AutoCAD 2021's mm.pss holds: pstamp{ fields{ drawing_name=1 … } ud_fields{ … } preview{ … } text_prop{ … } pstamp_units{ … } logfile{ … } }.

Constructors

__init__

def __init__(self) -> None

Properties and fields

StartFont

.NET

StartFont: ClassVar[str]

The font AutoCAD starts with: Segoe UI.

StartHeight

.NET

StartHeight: ClassVar[float]

The text height AutoCAD starts with, in CadPlotStamp.Units: 0.2.

StartLogFile

.NET

StartLogFile: ClassVar[str]

The log file AutoCAD starts with: plot.log.

StartOffset

.NET

StartOffset: ClassVar[float]

The offset from the corner AutoCAD starts with, along each axis, in CadPlotStamp.Units: 0.1.

DateAndTime

.NET

@property
def DateAndTime(self) -> bool
@DateAndTime.setter
def DateAndTime(self, value: bool) -> None

Gets or sets whether the stamp holds the date and time of the plot; on to start with.

DeviceName

.NET

@property
def DeviceName(self) -> bool
@DeviceName.setter
def DeviceName(self, value: bool) -> None

Gets or sets whether the stamp holds the name of the plotter; on to start with.

DrawingName

.NET

@property
def DrawingName(self) -> bool
@DrawingName.setter
def DrawingName(self, value: bool) -> None

Gets or sets whether the stamp holds the name of the drawing, with its folder; on to start with.

FontName

.NET

@property
def FontName(self) -> str
@FontName.setter
def FontName(self, value: str | None) -> None

Gets or sets the font of the stamp: CadPlotStamp.StartFont to start with.

LayoutName

.NET

@property
def LayoutName(self) -> bool
@LayoutName.setter
def LayoutName(self, value: bool) -> None

Gets or sets whether the stamp holds the name of the layout plotted; off to start with.

Location

.NET

@property
def Location(self) -> CadPlotStampCorner
@Location.setter
def Location(self, value: CadPlotStampCorner) -> None

Gets or sets the corner of the sheet the stamp is put in; the lower left to start with.

LogFile

.NET

@property
def LogFile(self) -> str
@LogFile.setter
def LogFile(self, value: str | None) -> None

Gets or sets the log file; a name with no folder is put beside the plot. CadPlotStamp.StartLogFile to start with.

LoginName

.NET

@property
def LoginName(self) -> bool
@LoginName.setter
def LoginName(self, value: bool) -> None

Gets or sets whether the stamp holds the login name of the user; off to start with.

OffsetFromPaperBorder

.NET

@property
def OffsetFromPaperBorder(self) -> bool
@OffsetFromPaperBorder.setter
def OffsetFromPaperBorder(self, value: bool) -> None

Gets or sets whether the offset is measured from the edge of the sheet; off, it is from the printable area, as it starts.

OffsetX

.NET

@property
def OffsetX(self) -> float
@OffsetX.setter
def OffsetX(self, value: float) -> None

Gets or sets how far the stamp stands from the sides of the corner along X, in CadPlotStamp.Units: CadPlotStamp.StartOffset to start with.

OffsetY

.NET

@property
def OffsetY(self) -> float
@OffsetY.setter
def OffsetY(self, value: float) -> None

Gets or sets how far the stamp stands from the sides of the corner along Y, in CadPlotStamp.Units.

On

.NET

@property
def On(self) -> bool
@On.setter
def On(self, value: bool) -> None

Gets or sets whether plots are stamped; off to start with.

PaperSize

.NET

@property
def PaperSize(self) -> bool
@PaperSize.setter
def PaperSize(self, value: bool) -> None

Gets or sets whether the stamp holds the name of the sheet; off to start with.

PlotScale

.NET

@property
def PlotScale(self) -> bool
@PlotScale.setter
def PlotScale(self, value: bool) -> None

Gets or sets whether the stamp holds the plot scale; off to start with.

SingleLine

.NET

@property
def SingleLine(self) -> bool
@SingleLine.setter
def SingleLine(self, value: bool) -> None

Gets or sets whether the stamp is one line of fields set apart by two spaces; off, each field is a line, as it starts.

TextHeight

.NET

@property
def TextHeight(self) -> float
@TextHeight.setter
def TextHeight(self, value: float) -> None

Gets or sets the height of the letters, in CadPlotStamp.Units: CadPlotStamp.StartHeight to start with.

Units

.NET

@property
def Units(self) -> CadPlotStampUnits
@Units.setter
def Units(self, value: CadPlotStampUnits) -> None

Gets or sets the units of the offset and the text height; inches to start with.

UpsideDown

.NET

@property
def UpsideDown(self) -> bool
@UpsideDown.setter
def UpsideDown(self, value: bool) -> None

Gets or sets whether the stamp is turned half round; off to start with.

UserField1

.NET

@property
def UserField1(self) -> str
@UserField1.setter
def UserField1(self, value: str | None) -> None

Gets or sets the first field of the user's own; empty for none, as it starts.

UserField2

.NET

@property
def UserField2(self) -> str
@UserField2.setter
def UserField2(self, value: str | None) -> None

Gets or sets the second field of the user's own; empty for none, as it starts.

UserFields

.NET

@property
def UserFields(self) -> System.Collections.Generic.IReadOnlyList[str]
@UserFields.setter
def UserFields(self, value: System.Collections.Generic.IReadOnlyList[str] | None) -> None

Gets or sets the list of the user's own fields the Field 1 and Field 2 lists of Plot Stamp pick from, as its Add / Edit keeps them; empty to start. The list is copied, so that a stamp and its CadPlotStamp.Clone keep their own.

Vertical

.NET

@property
def Vertical(self) -> bool
@Vertical.setter
def Vertical(self, value: bool) -> None

Gets or sets whether the stamp reads up the sheet, a quarter turned, instead of along it; off to start with.

WriteLog

.NET

@property
def WriteLog(self) -> bool
@WriteLog.setter
def WriteLog(self, value: bool) -> None

Gets or sets whether each stamp is also written to the log file; on to start with.

Methods

Clone

.NET

def Clone(self) -> CadPlotStamp

Makes a copy that changes apart from this one.

CopyFrom

.NET

def CopyFrom(self, other: CadPlotStamp) -> None

Takes every setting of another stamp, as the Plot Stamp dialog's OK gives the session's stamp what it edited in a copy, so that every drawing sharing the stamp sees it.

Footprint

.NET

def Footprint(self, page: CadPlotPage, width: float, height: float) -> DisplayBox

Where a block of the stamp's size stands on a sheet, as a box in the millimetres of the sheet, Y upward from its lower left corner: in CadPlotStamp.Location's corner of the printable area, or of the whole sheet where CadPlotStamp.OffsetFromPaperBorder, in by the offset on both sides. A CadPlotStamp.Vertical stamp has its width and height changed over, as it lies on the sheet.

def Footprint(
    self,
    page: CadPlotPage,
    width: float,
    height: float,
    plotUpsideDown: bool,
    unitsPerMillimetre: float,
) -> DisplayBox

Where a block of the stamp's size stands on a sheet, as CadPlotStamp.Footprint, the corner taken of the image as plotted, as AutoCAD's help puts it: a plot upside down turns the sheet half round, so that a stamp at the lower left stands at the upper right of the sheet; and the sheet's units given, a sheet of pixels at 96 to the inch (OpenCAD2D PNG and JPG) taking 96 / 25.4 to the millimetre.

Lines

.NET

def Lines(
    self,
    document: CadDocument,
    space: CadSpace,
    settings: CadPlotSettings,
    page: CadPlotPage,
    when: System.DateTime,
    login: str,
) -> System.Collections.Generic.IReadOnlyList[str]

The words of the stamp for a plot, in the order AutoCAD stamps them: the drawing, the layout, the date and time, the login name, the plotter, the sheet, the scale, then the two fields of the user's own that are not empty. One line where CadPlotStamp.SingleLine, the fields set apart by two spaces; else a line of each.

LoadParameterFile

.NET

def LoadParameterFile(self, path: str) -> None

Reads a plot stamp parameter file into the stamp, as Load of the Plot Stamp dialog: every setting the file holds replaces the stamp's; one it does not hold is kept.

LogLine

.NET

@staticmethod
def LogLine(lines: System.Collections.Generic.IReadOnlyList[str]) -> str

The line the log file takes for a stamp: its fields set apart by two spaces, on a line of their own.

LogPath

.NET

def LogPath(self, plotFile: str) -> str

The path of the log file for a plot written to a file: CadPlotStamp.LogFile, beside the plot where it names no folder.

SaveParameterFile

.NET

def SaveParameterFile(self, path: str) -> None

Writes the stamp to a plot stamp parameter file, as Save As of the Plot Stamp dialog: the fields, the user's fields with the two picked, the corner, the orientation, the offset, the text height, the units and the log file. The corner and orientation codes are those of AutoCAD's mm.pss for its defaults (location 0 lower left, orientation 1 horizontal), the others in the order of the Location list.

ScaleText

.NET

@staticmethod
def ScaleText(scale: float) -> str

A scale of millimetres of sheet to drawing unit as a ratio: 0.05 is 1:20, 2 is 2:1, to four places.

ToMillimetres

.NET

def ToMillimetres(self, value: float) -> float

A length in CadPlotStamp.Units in millimetres: 5.08 for 0.2 inch, 2.6458 for 10 pixels.