Table of Contents

CadMLeaderStyleEditor

from OpenCAD2D import CadMLeaderStyleEditor

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

The edits of the multileader styles, as AutoCAD's Multileader Style Manager (MLEADERSTYLE) makes them: each one undo step through CadDocument.ApplyEdit, refused where AutoCAD refuses it. A style changed gives its values to every multileader of it, but those a multileader has of its own.

Methods

Add

.NET

@staticmethod
def Add(document: CadDocument, name: str, from_: str, /) -> CadEditResult

Adds a style, as New of the Multileader Style Manager: a copy of the settings of another (Start with), under a name no style of the drawing has, letters of either case the same; the dictionary ACAD_MLEADERSTYLE made where the drawing has none, and the named object dictionary first where the drawing was written without it. A copy of an annotative style is annotative, as AutoCAD's New starts from the style's Annotative box.

AddStandard

.NET

@staticmethod
def AddStandard(document: CadDocument) -> CadEditResult

Adds the presenter's metric Standard where the drawing has no multileader style of that name, as AutoCAD's drawing always has it; one undo step, nothing where it has one.

Apply

.NET

@staticmethod
def Apply(document: CadDocument, name: str, settings: CadMLeaderStyleSettings) -> CadEditResult

Writes the settings into a style, as OK of the Modify Multileader Style dialog, and gives every multileader of the style its values, those it has of its own kept (a value that differed from the style's before). Nothing is written, and nothing refused, where they are the style's already.

Current

.NET

@staticmethod
def Current(database: DxfDatabase) -> str

Gets the name of the current multileader style (CMLEADERSTYLE), as the dictionary spells it; Standard where the drawing names none it has.

Delete

.NET

@staticmethod
def Delete(document: CadDocument, name: str) -> CadEditResult

Deletes a style, as Delete of the Multileader Style Manager: refused for Standard, the current style and a style a multileader is drawn in, as AutoCAD greys Delete for them.

Find

.NET

@staticmethod
def Find(database: DxfDatabase, name: str) -> DxfMLeaderStyle

Gets the style of a name; null where the drawing has none.

KeysOf

.NET

@staticmethod
def KeysOf(part: CadStylePart) -> System.Collections.Generic.IReadOnlyList[str]

Gets the keys of the settings that set a part, in the order of the dialog: Leader Format, Leader Structure, Content, each in its rows' order.

Measures

.NET

@staticmethod
def Measures(
    sample: CadStyleSample,
    settings: CadMLeaderStyleSettings,
    key: str,
) -> System.Collections.Generic.IReadOnlyList[CadStyleMeasure]

Measures what a setting sets on the sample, as a callout: the arrowhead's size along the leader from its tip (ArrowSize), the landing's length (LandingDistance), the gap from its end to the words (LandingGap), the height of the words (TextHeight) and the angle the first segment is held to (FirstSegmentAngle, an arc from the x axis), and, of a style that leaves the landing out, the ghost of the dogleg it would have (IncludeLanding). The points are in the drawing coordinates of the sample, so the lengths are the values times the style's scale; the label has the value as the dialog shows it.

PartsOf

.NET

@staticmethod
def PartsOf(key: str) -> System.Collections.Generic.IReadOnlyList[CadStylePart]

Gets the parts of the sample a setting of the Modify Multileader Style dialog sets. The key is the name of the setting, as CadMLeaderStyleSettings names it (ArrowSize, LandingGap), letters of either case the same. A setting of no part (the break size, annotative, the scale) gives none.

PreviewSample

.NET

@staticmethod
def PreviewSample(source: DxfDatabase, settings: CadMLeaderStyleSettings) -> CadStyleSample

Makes the sample multileader of the Manager's preview with its parts told apart: the drawing of CadMLeaderStyleEditor.Sample, its multileader broken into the entities it draws as (DxfMLeader.ExplodeBroken) in model space, each with a handle of its own, the multileader erased. The parts follow the order the pieces come in: the content first, the words (CadStylePart.Text) or the block (CadStylePart.Block); then the dogleg of each leader (CadStylePart.Landing); then each leader line (CadStylePart.LeaderLine, a polyline or a spline) and its arrowhead (CadStylePart.Arrow, a solid or the insert of its block).

Rename

.NET

@staticmethod
def Rename(document: CadDocument, name: str, newName: str) -> CadEditResult

Renames a style with the multileaders drawn in it, as -RENAME multileadeRstyle does: the entry of the dictionary ACAD_MLEADERSTYLE takes the new name, which the multileaders follow since they point at the style by its handle, and the current style (CMLEADERSTYLE) names it where it was the one renamed. Standard keeps its name.

Sample

.NET

@staticmethod
def Sample(source: DxfDatabase, settings: CadMLeaderStyleSettings) -> DxfDatabase

Makes the sample multileader of the Manager's preview: a drawing of its own whose one style, Standard, has the settings (its text style Standard given the font of the one they name in the drawing edited, its leaders ByBlock), and a multileader of the words "Default Text" in it, its arrow at the origin and its landing 6 by 4 text heights up to the right, made as MLEADER makes one; with no landing where the settings leave it out (its dogleg not drawn, the leader line running on to the words).

SetCurrent

.NET

@staticmethod
def SetCurrent(document: CadDocument, name: str) -> CadEditResult

Makes a style current (CMLEADERSTYLE), as Set Current does, and gives MLEADERSCALE the style's scale, nought for an annotative style, as AutoCAD 2021 does each time the variable is set, to the style already current too: with MLEADERSCALE set to 2, a style of scale 5 made current gives 5 again. Refused where the drawing has no such style, or cannot hold the variables: a drawing with no CLASSES section to list DICTIONARYVAR in.

Styles

.NET

@staticmethod
def Styles(database: DxfDatabase) -> System.Collections.Generic.IReadOnlyList[str]

Gets the multileader styles of a drawing, by name, letters of either case alike first: the entries of its dictionary ACAD_MLEADERSTYLE that are styles; none where it has none.

Uses

.NET

@staticmethod
def Uses(database: DxfDatabase, name: str) -> System.Collections.Generic.IReadOnlyList[str]

Gets the handles of the multileaders drawn in a style: those of model space, the layouts and the blocks that name it, in the order of the blocks and their entities, as AutoCAD counts what keeps a style from being deleted.

WhyNotDeleted

.NET

@staticmethod
def WhyNotDeleted(database: DxfDatabase, name: str) -> str

Gets why a style may not be deleted, as Delete is greyed: Standard, the current style, a style a multileader uses; null where it may.