Table of Contents

CadClipboardData

from OpenCAD2D import CadClipboardData

class CadClipboardData(System.Object) ยท CadClipboardData in the .NET reference

What a clipboard holds for the presenter: objects copied, as a small DXF of their own (the objects in its model space with the layers, linetypes, styles and blocks they need, its $INSBASE the base point they are pasted by), with where they came from; and plain text, the words of the TEXTs and MTEXTs copied for other apps, or text another app copied, which PASTECLIP pastes as an MTEXT; and a picture another app copied, which PASTECLIP pastes as an OLE object where there are no objects and no text.

Constructors

__init__

.NET

def __init__(
    self,
    drawing: str,
    text: str,
    source: str | None = ...,
    sourceName: str | None = ...,
    spaceName: str | None = ...,
    count: int = ...,
    picture: Sequence[int] | System.Array[int] | None = ...,
) -> None

Makes what a clipboard holds.

Properties and fields

Format

.NET

Format: ClassVar[str]

The name of the private clipboard format the objects go on the Windows clipboard under.

Count

.NET

@property
def Count(self) -> int

Gets how many objects were copied.

Drawing

.NET

@property
def Drawing(self) -> str | None

Gets the DXF of the objects copied; null for text alone.

HasObjects

.NET

@property
def HasObjects(self) -> bool

Gets whether the clipboard holds objects of a drawing.

Picture

.NET

@property
def Picture(self) -> System.Array[int] | None

Gets the bytes of a bitmap file or a PNG another app copied; null for none. It goes on no clipboard from here and is not part of the private format.

Source

.NET

@property
def Source(self) -> str | None

Gets what tells the drawing copied from from any other; null for text of another app.

SourceName

.NET

@property
def SourceName(self) -> str | None

Gets the name of the drawing copied from; null for none.

SpaceName

.NET

@property
def SpaceName(self) -> str | None

Gets the space copied from; null for none.

Text

.NET

@property
def Text(self) -> str | None

Gets the plain text; null for none.

Methods

FromFormat

.NET

@staticmethod
def FromFormat(format: str, text: str) -> CadClipboardData

Reads what CadClipboardData.ToFormat wrote, with the plain text beside it; null where the format is not one this writes.

ToFormat

.NET

def ToFormat(self) -> str

Writes the objects as the private clipboard format holds them: a few lines saying where they came from, then the DXF; null where there are no objects.