Table of Contents

Method CopyFrom

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

CopyFrom(DxfTable, DxfTableCopyOptions, DxfCellRange, DxfCellRange)

Copies cells of another table of the drawing, or of this one, into this table, as AutoCAD's CopyFrom(source, options, sourceRange, targetRange): the cells of the source range, row by row, from the top left cell of the target range on, each with its content (its kind, text or value, block and attribute values) and its look (its overrides and their flags); the blocks of merged cells wholly within the source range merged alike, those of this table the copy meets unmerged. A field (344) a cell points at is the source cell's own, and is not copied: the copy holds the text the cell shows, so SkipField and SkipFormula are taken and change nothing. The ranges of cells linked to data wholly within the source range are linked alike, to the same DATALINKs, and those of this table the copy meets taken out, as merges are. A cell emptied while the drawing is open holds no content to give, as AutoCAD 2021 copied B-12 reset (D33e f10 to f13, f17, g07, g16): the cell copied to keeps its content, the looks of it and its kind of value, and takes the look of the cell alone, its alignment, background and lines, unless SkipFormat; Mark given B-12 reset loses its middle centre and keeps GH_TXT and 3.5. A cell given a content is no longer one emptied in the session (D33e g14). Cells past this table's last row or column are left out, unless ExpandOrContractTable grows the table to hold them, its new rows and columns as high and wide as the source's; the library only grows a table with it, never shrinks one. The record is written once; the block AutoCAD drew the table with is not drawn anew. The header and data rows of the table of 3 rows, (1, 0) to (2, 1), copied to (3, 0) with ExpandOrContractTable make it a table of 5 rows, Mark and Qty in row 3 and B-12 in row 4.

public DxfCellRange CopyFrom(DxfTable source, DxfTableCopyOptions options, DxfCellRange sourceRange, DxfCellRange targetRange)

Parameters

source DxfTable

The table copied from, of this drawing; this table itself among them.

options DxfTableCopyOptions

None, or of ExpandOrContractTable, SkipContent (the look alone copied), SkipFormat (the content alone), SkipMerges (the merges of this table kept, none copied), SkipField and SkipFormula (no field is copied in any case), SkipDataLink (the data links of this table kept, none copied), TableCopyRowHeight and TableCopyColumnWidth (the heights and widths of the source's rows and columns given to those copied to).

sourceRange DxfCellRange

The cells copied, within the source; null for every cell of it.

targetRange DxfCellRange

Where they go, by its top left cell, one of this table's, or just past its last row or column with ExpandOrContractTable; null for the place of the source range.

Returns

DxfCellRange

The cells copied to.

Exceptions

ArgumentNullException

Thrown when the source is null.

ArgumentException

Thrown when the source is of another drawing, or the options ask for what the library does not carry out.

ArgumentOutOfRangeException

Thrown when the source range reaches past the source, or the copy begins at no cell of this table.

InvalidOperationException

Thrown when a table's record does not hold its cells, heights and widths, or this table is erased.