Table of Contents

CadMTextMask

from OpenCAD2D import CadMTextMask

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

The background mask of an MTEXT, as AutoCAD 2021's Background Mask dialog sets it: whether the words stand on a filled box, how far the box reaches past them (the border offset factor, a multiple of the text height from 1 to 5, 1.5 by default), and its colour, the drawing's background colour or one of its own. An MTEXT 5 high with the mask on at the factor 1.5 stands on a box 2.5 past its words on every side. It is written as the flags of group 90 (1 the mask, 2 the drawing's background colour), 45 the factor and 63, 421 the colour.

Constructors

__init__

.NET

def __init__(self, useMask: bool, offsetFactor: float, useDrawingBackground: bool, fillColor: DxfColor) -> None

Makes a mask.

Properties and fields

DefaultOffsetFactor

.NET

DefaultOffsetFactor: ClassVar[float]

The factor AutoCAD gives a mask the dialog has not set: 1.5.

FillColor

.NET

@property
def FillColor(self) -> DxfColor | None

Gets the colour of the mask; null where the MTEXT gives none (by layer).

OffsetFactor

.NET

@property
def OffsetFactor(self) -> float

Gets how far the mask reaches past the words, a multiple of the text height.

UseDrawingBackground

.NET

@property
def UseDrawingBackground(self) -> bool

Gets whether the mask takes the drawing's background colour.

UseMask

.NET

@property
def UseMask(self) -> bool

Gets whether the words stand on a mask.

Methods

ApplyTo

.NET

def ApplyTo(self, text: DxfMText) -> None

Gives an MTEXT this mask: the fill and the drawing's background colour switched as it says, the factor and, where the mask takes a colour of its own, the colour written; an MTEXT with the mask off is left with the record it has but for the two flags. What the MTEXT already has is not written again.

Equals

.NET

def Equals(self, other: CadMTextMask) -> bool
def Equals(self, obj: object) -> bool

GetHashCode

.NET

def GetHashCode(self) -> int

Of

.NET

@staticmethod
def Of(text: DxfMText) -> CadMTextMask

Reads the mask an MTEXT has: none for one with no background fill.