Table of Contents

CadExtraction

from OpenCAD2D import CadExtraction

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

The Data Extraction of AutoCAD 2021 as the presenter runs it: the objects of the current drawing (all, or those selected) and of other drawing files are read, the object types and properties chosen are kept, identical rows are combined into one with a Count, the rows are filtered and sorted, and the result goes to a table in the drawing, whose cells are linked to a data link of the data extraction's own, and to a file of .xlsx, .csv or .txt. The table is updated by DATALINKUPDATE (or Update Table Data Links) by running the extraction again from its .dxe file.

Properties and fields

Categories

.NET

Categories: ClassVar[System.Collections.Generic.IReadOnlyList[str]]

The categories of properties, in the order the Select Properties page lists them.

Methods

Properties

.NET

@staticmethod
def Properties(
    current: CadDocument,
    settings: CadExtractionSettings,
) -> System.Collections.Generic.IReadOnlyList[CadExtractionProperty]

The properties of the objects of the types chosen, as the Select Properties page lists them: the General, Geometry, Misc and Drawing properties the objects have, an Attribute for each tag of the blocks, a Dynamic Block for each dynamic property; by category (as CadExtraction.Categories orders them) and name. The categories the settings leave out are not listed.

Rerun

.NET

@staticmethod
def Rerun(document: CadDocument, link: DxfDataLink) -> CadSheet

Runs a data extraction again from its link, as updating a data extraction table does: the link's connection string is the .dxe file (a relative one is of the drawing's folder), whose settings are run on the drawing as it stands.

Run

.NET

@staticmethod
def Run(current: CadDocument, settings: CadExtractionSettings) -> CadExtractionResult

Runs the extraction: the objects read, those of the types chosen kept, a column for each property chosen (and the Count and Name columns the settings show), identical rows combined with their count, the filters applied and the sorts, the first the main one, the rows not moved by a sort kept in the order they were read.

Types

.NET

@staticmethod
def Types(
    current: CadDocument,
    settings: CadExtractionSettings,
) -> tuple[System.Collections.Generic.IReadOnlyList[CadExtractionType], System.Collections.Generic.IReadOnlyList[str]]

The object types the sources hold, as the Select Objects page lists them, after its display options: every kind of object and every block by name, with how many; the blocks of the current drawing that are defined and not inserted too (count nought) unless CadExtractionSettings.UsedOnly leaves them out. By name, letters of either case alike.

WriteFile

.NET

@staticmethod
def WriteFile(path: str, sheet: CadSheet) -> None

Writes cells to a file by its extension: .xlsx a workbook of one sheet (numbers as numbers), .csv comma separated values, .txt tab separated; any other extension, as the .xls and .mdb AutoCAD also writes, is refused.