Table of Contents

CadFind

from OpenCAD2D import CadFind

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

FIND, as AutoCAD's Find and Replace: the TEXT, MTEXT, attribute values, dimension text, multileader text and table cells of a drawing that hold a text, and the text replaced in one of them or in all, each replacement one undo step. MTEXT is searched by its words, its formatting taken out, and replaced in its words alone, every code kept in its place: {\fArial|b1;Bolts M20} searched for M20 and replaced by M24 is {\fArial|b1;Bolts M24}.

Methods

Find

.NET

@staticmethod
def Find(
    document: CadDocument,
    what: str,
    options: CadFindOptions,
    scope: CadFindScope,
    selected: System.Collections.Generic.IEnumerable[str] | None = ...,
) -> System.Collections.Generic.IReadOnlyList[CadFindResult]

Finds a text in the drawing, in the order of the spaces' tabs and then of each space.

Replace

.NET

@staticmethod
def Replace(
    document: CadDocument,
    result: CadFindResult,
    what: str,
    with_: str,
    /,
    options: CadFindOptions,
) -> CadEditResult

Replaces the text searched for in one result, every time it is in it, as Replace does: one undo step "FIND". An object whose owner keeps it (CadEditRule) is refused as any edit of it is.

ReplaceAll

.NET

@staticmethod
def ReplaceAll(
    document: CadDocument,
    results: System.Collections.Generic.IReadOnlyList[CadFindResult],
    what: str,
    with_: str,
    /,
    options: CadFindOptions,
) -> CadEditResult

Replaces the text searched for in every result, as Replace All does: one undo step "FIND".