Tables of cells
Tables of cells (ACAD_TABLE): their cells and values, their structure, merging, grid lines, formulas and series, and their links to data.
The table and its cells
An ACAD_TABLE is a DxfTable: its NumRows, NumColumns, RowHeight(row), ColumnWidth(col), and each cell's
TextString, Value, CellType, merging (IsMergedCell, GetMergeRange), corners (GetCellExtents), block and
attribute values, and the look it holds of its own, Alignment, TextHeight, TextStyle and the colours, null where it
has none and takes its table style's, which DxfTableStyle reads. Its record is read once while it stands, every cell
of 1 000 rows in milliseconds. Its cells are written in the form of R2000 (text in 3 and 1) or of R2007 on (between
301 CELL_VALUE and 304 ACVALUE_END, the value in 2 and 1 and its text in 303 and 302), a text longer than 250 letters
cut into pieces of 250 letters as AutoCAD 2021 cuts it, an escape given counted as its one letter: AutoCAD reads a cell of
R2000 in pieces of 2 as empty, and the escapes of each piece alone. SetTextString and SetValue given the words a cell
has, as written or as read, change nothing. SetTextString, SetRowHeight, SetColumnWidth,
SetBlockScale, SetBlockRotation and SetBlockAttributeValue write that data, the table's block (*T12) left for
AutoCAD to draw anew. Scaled alike by TransformBy, a table scales the heights of its rows, the widths of its columns, its
cell margins and the text heights and block scales it and its cells override: a table of rows 10, 8 and 8 high scaled by 2
has rows 20, 16 and 16 high, where AutoCAD 2021 measures the rows anew by its font (22, 18 and 18). Mirrored, it stays readable, as AutoCAD 2021's TransformBy leaves it: its
normal the mirror's image of its normal, its direction the image reversed, and its point the image of the far end of its
top edge, so that the table at (300, -100), 70 wide, mirrored in the plane x = 280 stands at (190, -100) facing up. Mirrored
so that the image of its direction still reads left to right or upwards, it stands at the image of its point along that
image, its rows running the other way (FlowDirection BottomToTop, its 70 of 1 written in its head with the flag 0x04 of
its 93, as AutoCAD 2021 writes it): mirrored in y = -150 the table stands at (300, -200) along (1, 0, 0), and in the line at
45 degrees through (280, -100) at (280, -80) along (0, 1, 0), as AutoCAD's do. Scaled, every cell that has no text height of
its own is given the height of its kind of row, scaled, as its own (its 140 with its flag 0x20), as AutoCAD 2021 keeps a
table it scales: the table's own height for that kind of row where it has one, else its table style's, from the style the
table names, else the drawing's Standard, else AutoCAD's own Standard, the title 6 and the header and the data 4.5 in a
drawing of millimetres ($MEASUREMENT 1), 0.25 and 0.18 in one of inches. The table of point 54 scaled by 2 has the two
cells of its title 12 high and the others 9, its cell of its own 3.5 now 7. AutoCAD read the heights written as the table's
own instead as 0.18 in every cell, so none is written there. Its rows are still not measured by AutoCAD's font.
Table styles, new tables and their block
A TABLESTYLE of ACAD_TABLESTYLE is a DxfTableStyle (a table's TableStyle, which
it also sets): its Description, FlowDirection, HorizontalCellMargin and VerticalCellMargin, IsTitleSuppressed and
IsHeaderSuppressed, and for the title, the header and the data TextStyleName, TextHeight, Alignment, Color,
BackgroundColor, IsBackgroundColorNone and the lineweight, colour and showing of each of the six grid lines, read and
set as AutoCAD's TableStyle names them. A group the record leaves out reads as AutoCAD's Standard has it, of the
drawing's units: the title 6 and the header and data 4.5 high, margins of 1.5, in millimetres. new DxfTableStyle() is
that Standard, added by db.TableStyleDictionary.SetAt("GH_SCHEDULE", style) with every group AutoCAD writes of a style
(the data's cell, then the title's and the header's, each its text, fill and six lines); its map of cell styles is made
when the drawing is saved (see Saving tables made in code).
new DxfTable(position, rows, columns, rowHeight, columnWidth) makes a table in no file; appended, it names the drawing's
current table style, its first row is merged across as AutoCAD's title, and it is drawn in a new anonymous block, *T1
and on (new DxfBlockTableRecord { Name = "*T" } names one so too); in a drawing before R2007 its cells take the form of
R2000. RecomputeTableBlock() draws a table anew in its block from its cells, as AutoCAD's does: a SOLID for each filled
cell, a LINE for each run of a grid line of one look, none inside merged cells, an MTEXT for each cell's text at its
alignment, as wide as the cell less its margins, and an INSERT for each block cell, each look the cell's own, else the
table's of its row's kind, else its style's. A table of rows 9 high and columns 30 wide, its title merged across three
columns, is drawn with 9 lines; one of 100 rows of 20 columns, every cell written, in about 40 ms on .NET 8. Rows keep
their heights: a text taller than its row is not made room for. The block of a table is placed at the table's point,
its entities turned along the table's direction, as TransformBy carries them. The block of a block cell is placed by its
extents (the box its entities fill, an attribute definition among them by the words the cell shows for it where the drawing's
fonts measure them and none where it is invisible or its words empty, from its base point), not by its insertion point: the
box, turned by the cell's rotation and scaled, is aligned in the cell by the cell's alignment, the margins in from its sides, so
that a block 10 by 40 from its base point at scale 1 in a cell of the middle, 30 wide and 8 high at x 40 and y -18, stands with
its insertion point at (50, -42). A cell whose block is fitted (SetAutoScale) is drawn at the scale that fits the turned box in
the cell less its margins, 0.125 for that block (5 high within the margins over 40), and the 144 of the cell is left as it is.
A block turned by exactly 90, 180 or 270 degrees stands where AutoCAD 2021 puts it, off the aligned box by the block's own
width and height (0 and minus the width at 90).
The INSERT of a block cell is followed by an ATTRIB for each attribute definition of its block that is not constant, an
invisible one too, in the order of the block, filled and placed by the INSERT's transformation as the INSERT command fills one
(SetAttributeFromBlock), its words the value the cell gives the definition (SetBlockAttributeValue), else the definition's
own, as AutoCAD 2021 draws them in the table's block: the definition SIZE of BOLT at (22, 0), 2.5 high, in a cell at scale 2 turned 30
degrees is an ATTRIB 5 high turned 30 degrees, at the definition's place taken by the INSERT's transformation. A constant
definition has no ATTRIB, and a table drawn again has each once. AutoCAD 2021 lays a block with a definition that is not constant
out by two boxes (probed in its console, margins 1.5, one pass of its layout). The box the block is aligned in its cell by, and
the room it takes, are those of the words in Arial (arial.ttf, found in the drawing's FontSearchPath), whatever the font of
the definition's style: AB at 2.5 high is 4.66 wide in Arial and 4.17 in txt.shx, M12 6.79 and 5.83, DEFAULT 15.91 and 16.67. The
scale that fits the block to its cell comes from the box of the words in the definition's own font: a block 20 by 10 with AB at
x 22 in a cell 40 wide is fitted at 37 over 26.17, 1.41401, and the column, which that scale gives 26.66 of Arial to hold, is
widened to 40.69607 by the presenter (CadTableEditor), the block filling it from its margin. A constant definition is the same
box in both, and a block with none has one box. RecomputeTableBlock alone, with no layout to widen the column, fits the block
by the wider of the two boxes, 37 over 26.66, 1.38787, inside the cell. AutoCAD run twice (GenerateLayout and
RecomputeTableBlock both) went on from the widened column, 1.44061 and 41.40525 for that block, and was seen to widen
it again, 1.8 % a time (the ratio of the block's Arial box to its own, 26.66 over 26.17). That growth has not been
reproduced: the same two calls made 12 to 14 times in the console, through the .NET API, over a fitted block cell of seven
tables (three new ones, the column left at 40, and started from the widened 40.69607 with the scale 1.41401 and with 1; four
read from a file, the column left alone, set to 40, to 20, and to 20 with the row set to 30), left the column and the scale
where the first pass put them, to the last digit, so the presenter, which settles after one pass, stays as it is.
Lines set on the top left cell of a block of merged cells (SetGridColor, SetGridLineWeight, SetGridVisibility) are given to
the cells along the block's edges, as AutoCAD 2021 reads them from a file: its top over the cells of its first row, its left down
those of its first column, its bottom along a block of one row and its right down a block of one column; a line another cell
holds of its own is kept. On the title merged across 4 columns, a top of lineweight 50 is the top of its four cells.
The lines of a cell set one at a time (SetGridColor, SetGridLineWeight, SetGridVisibility and SetGridProperty of a cell)
read the cells they and the cells beside them need from the cells' own bytes and write the bytes of the cells they change into
their places in the record the last of them wrote, kept apart from it and put in once like those of the other setters of a cell
(see Building a table cell by cell below), where each read and wrote every group of it: the four settings of each of the 2 000
cells of a table of 200 rows by 10 columns, 8 000 calls, took 141 s (17.7 ms a call, growing with the table) and then 7 s
(0.9 ms), and now each of 931 cells set takes 16 ms (206 ms before) and 10 000 cells 0.08 s, the drawing the same to the byte.
The record is written whole the first time, so that its groups stand as the library writes them; a call that changes nothing
writes nothing.
SetGridProperty(range, ...) still sets the lines of a block of cells in one writing.
Saving tables made in code
A table or a table style written in the session (a table made by new DxfTable, a style added by SetAt, or one of a read
drawing that was changed) is saved with what AutoCAD 2021 builds of it when it reads a file, in every version of R2007 and
later and going down to R2000 and R2004 (db.Save(path), db.Save(stream) and the two forms with a version; ToText() is
the drawing as it stands, and the drawing itself is never changed by saving it). AutoCAD gives a table that has no
TABLECONTENT, in a drawing of R2007 or later, an extension dictionary holding ACAD_XREC_ROUNDTRIP, in it the XRECORD of
ACAD_ROUNDTRIP_2008_TABLE_ENTITY (70 2, 90 1, a point of nought, 90 0, the count of columns, the handle of the
TABLEGEOMETRY in 361), the TABLECONTENT and the TABLEGEOMETRY; and a table style that has none an extension dictionary with
ACAD_ROUNDTRIP_2008_TABLESTYLE_CELLSTYLEMAP and a CELLSTYLEMAP. The library writes the same, and lists the table and its
style in ACDB_RECOMPOSE_DATA and the classes TABLECONTENT, TABLEGEOMETRY and CELLSTYLEMAP, counted:
- The TABLECONTENT holds each column's width, each row's kind (1 the title, 2 the header, 3 data) and height, and for each cell
the checksum of its text, its value as the table holds it, and its looks as AutoCAD reads them from the cell's groups:
the content format (90 the flags of what the cell overrides, 3 for the kind and format of a value, 4 its turn, 32 its text
colour, 64 its text style, 128 its height, with the unit, the kind of the value, its format and the turn in radians) and the
table format (91 the flags 16 for an alignment and 512 for a fill, with the fill's colour in 62 and 257 for none), and the lines the cell sets,
each a GRIDFORMAT of its colour, lineweight and showing; the cells a merged block hides hold no content (
95 0), and the blocks are listed after the last row. A table of 4 rows and 3 columns, 9 high and 30 wide, its title merged across, is rows1/9,2/9,3/9and3/9and the block0 0 0 2. - The TABLEGEOMETRY holds a cell of no size (
93 0,40 0,41 0,330 0,94 0) for each cell, as AutoCAD builds it before it has laid the table out. - The map of cell styles holds, for the title, the header and the data, the fill (62 of the table format, 257 where it is none), the text style (a handle), height, colour and alignment, the margins (the vertical, the horizontal, then 0.18 twice) and the six lines of the style (colour, lineweight, 1 in 93 where a line is hidden).
- The cells of the table record are left as they were but for the lines. AutoCAD reads a line between two cells as the top or
left of the cell below or right of it, and writes it so: the bottom of a cell set with
SetGridColoris the top of the cell below, the right the left of the cell beside, those of the cells on the table's rim stay, each line with all three properties flagged, its lineweight (279, 275, 276, 278; -2 by block) and its colour (0 by block) written and its showing written (0) where it is hidden, and a line that has only defaults is none. The line between rows of two kinds (the title and the header, the header and the data) is the bottom of the kind above where the style's top of the kind below is a default: a title whose style has a red bottom gives the header's cells a red top; a header whose top is yellow is left as it is. A cell that gives a colour for its background is written filled (283 0), as AutoCAD reads it. - The values of an empty cell keep their flags
93 7, which AutoCAD changes to 3 in a table that has no TABLECONTENT and leaves as 7 where it has one.
A table that holds its TABLECONTENT already is not given another, and a drawing nothing was written to is saved as it was read. Left as they are, so that AutoCAD builds what it builds: a table of a drawing of R2000 or R2004 (the cells of the form before R2007; the TABLEGEOMETRY and the rows' heights of a table going down are AutoCAD's to lay out too), a table with a block cell, a field or a link, a table with lines or looks of its own for a kind of rows, and a table whose extension dictionary exists already. AutoCAD lays a table with a TABLECONTENT out anew when it reads it unless its TABLEGEOMETRY is the laid out one, which needs the metrics of a font: the rows grow to fit their text (the title of a style of 6 high to 11, a header to the height of its text) as they do when its cells are edited in AutoCAD, and the cells of the format it writes then gain their margins and the six lines; the library does not measure text. A line written hidden is written 0, as AutoCAD reads a hidden line, where AutoCAD writes 1 and reads it back as drawn.
Saving costs in proportion to what is written. Five tables of 100 rows by 20 columns (10 000 cells, 11.3 MB saved) take 127 ms to save as R2018 on .NET Framework 4.8, 295 ms as R2013 and 330 ms as R2000, with 189 MB allocated for the first; 1 000 cells take 11, 27 and 35 ms, and 100 cells 2, 4 and 4. A drawing of many tables pays for each table, not for the objects around it: 400 tables of 3 rows and 3 columns take 252 ms as R2018 among 4 600 other objects and 245 ms among 100 (0.6 ms a table). The completed copy of a drawing is kept, weakly, until the drawing changes, so that saving it again as it stands, in another version for one, makes the content once: a second save of those 10 000 cells as R2018 takes 6 ms, until a garbage collection drops the copy.
Building a table cell by cell costs in proportion to the cell. The first edits of a table write its record whole, as the file
writes a group; from then on SetTextString, SetValue and the setters of a cell's look (SetAlignment, SetTextHeight,
SetTextStyle, SetContentColor, SetBackgroundColor, SetTextRotation), SetFormat, SetDataType, SetBackgroundColorNone,
SetOverrides, ResetValue, SetCellType and the lines of a cell (SetGridColor, SetGridLineWeight, SetGridVisibility)
read the groups of the cell's own bytes and write them back as that cell's own bytes, and the record's bytes are those a writing of
every group would give. The bytes of the cells are kept apart from the record and put in their places once, when the record is next
read (a read of the table or of its entity, a copy, a save): a run of 10 000 cells set one after another takes 0.44 s and allocates
491 MB on .NET Framework 4.8 (0.37 s and 477 MB on .NET 10) where each cell copied the 2.5 MB of the record, 3.6 s and 13.5 GB. The
layout the table reads (its row types, its own looks of a kind of row) is kept for the record the cells make by noting each cell
written, put into it when it is next read, so that SetBackgroundColorNone and SetOverrides do not read every group of the record.
The last cell of a table ends where the table's own groups begin, which its flags decide as they stand: its bytes are written into
the record at once, not kept apart, and the place of its end is found again from the record after each write, as a reading of the
record places it (an edit of the cell can change its flags, and the next edit would read the table's own groups as the cell's). A
reset of each of 931 cells takes 4 ms on .NET Framework 4.8 (9 ms on .NET 10) where it took 4.0 s (3.3 s) and 6.3 GB, and of 10 000
cells 33 ms; the lines of each of 931 cells take 16 ms (24) where they took 206 ms (146), and of 10 000 cells 0.08 s (0.21 s on
.NET 10, where it took 11.7 s and 46 GB). The lines of the rows of a kind (SetGridColor(color, borders, rows) and the lineweight and
showing setters beside it) write the groups of the table's head and of its own part after the cells into their places and copy the
cells as they stand, where each call read and wrote every group of the record: 108 calls on a table of 931 cells take 9 ms and 21 MB
where they took 590 ms and 982 MB on .NET Framework 4.8 (14 ms where it took 420 on .NET 10). A table read from a file pays once, at
its second edit, for the places of its cells (1.5 to 2.2 ms for 931 cells), and the first edit of a table not yet written whole by the
library reads and writes its record whole, as before. SetValueFromText, the setters of a block cell (SetAutoScale, SetBlockScale, SetBlockRotation, SetBlockAttributeValue) and
SetFormula write the bytes of their own cell as well, a text typed into each of the 466 text cells of a table of 931 taking 26 ms
where it took 4 s. MergeCells and UnmergeCells write the cells they change and no others, those of the range and the cells along
its edges (the blocks of merged cells are kept from one call to the next, for as long as every cell is as a whole writing leaves it),
and a table that holds a TABLECONTENT, as a table read from a file does, has it read once for the first merge, the bytes of the cells it
emptied and of its list of merged ranges then put in their places and the rest copied: 192 merges of two cells in a table of 931 cells
take 0.07 s and 53 MB on .NET Framework 4.8 (0.06 s on .NET 10) where they took 1.6 s and 1.8 GB, and 0.09 s and 235 MB for the table
of a file with its TABLECONTENT, where they took 6 s and 6.8 GB. A TABLECONTENT whose groups do not stand as the file writes them
(a comment among them, or one after the last group) and a table with a cell not as a whole writing leaves it
(a cell marked merged that no block holds) are written whole, as before. Every other edit of the TABLECONTENT is written the same way:
the table keeps the TABLECONTENT it read, each row and cell with where it stands in the record's bytes, and ResetValue of a block cell (which takes
the block's content out of it), InsertRows, InsertRowsAndInherit, InsertColumns, InsertColumnsAndInherit, DeleteRows, DeleteColumns, SetSize
and a merge across a cell holding a field copy the rows they do not touch as they stand, write the cells and rows they make or change, and put the
list of merged ranges and the fields listed after the rows in their places, so that an edit costs the bytes of the record (1.1 MB for 931 cells) and
not the reading and the writing of its 100 000 groups. In a table of 49 rows by 19 columns read from a file, a reset of each of its 456 block cells
takes 0.1 to 0.3 s and 0.5 GB on .NET Framework 4.8 (0.13 s on .NET 10) where it took 12.1 s and 12.7 GB (7.0 s); a row put in takes 2.4 ms (3.3 ms) where it took
25.7 ms (15.2 ms), a row taken out 3.3 ms (3.7 ms) where it took 29.7 ms (18.1 ms), a column put in 4.0 ms (5.7 ms) where it took 40.4 ms (17.4 ms). The layout
of the ACAD_TABLE is kept after such an edit, as the record's groups the edit wrote, so that the next does not read the record's groups again, and the
fields a cell lets go of are looked for among the bytes of the cells where their places are known. The ACAD_TABLE of a table the library wrote whole before
is written from its own bytes by rows and columns put in and taken out: each cell that comes out as it was is copied as it stands, the head and the cells made
or changed are written, and the places of the cells are kept for the next edit; the bytes are those a writing of every group gives. On 931 cells (medians of
20 edits, .NET Framework 4.8 and, in brackets, .NET 10) a row put in takes 2.0 ms (1.35) where it took 3.5 ms (2.3), a row put in taking the look of another 2.3 ms (1.4)
where 3.7 (2.3), a row taken out 1.9 ms (1.0) where 3.4 (2.2), a column put in 2.3 ms (1.3) where 3.8 (2.5) and a column taken out 1.65 ms (1.0) where 3.25 (2.0). A table
that has not been written whole is written whole by its first such edit, and from the second on the places of its cells are known. SetRowHeight and SetColumnWidth
write their groups into the head the same way, 0.28 and 0.33 ms where each took 1.4, and no longer leave the table to read the record's groups again at its next edit:
a merge after one takes 0.6 ms where it took 5.7, a text set 0.01 ms where 2.5, a row put in 1.4 ms where 6.7 (which also read the whole of the record again). The
layout the table reads takes the cells written one by one since into it, so that the edits that still write the record whole do not
read its groups again after a cell is set. The search the file is made for what else points at a field a merge lets go of reads each record's groups one at a time,
none kept, and passes over a record whose bytes hold the digits of none of the handles looked for, in either case (a pointer is hexadecimal digits, in any case, with zeros
before them): a merge across a field takes 0.9 ms where it took 3.0, and allocates 2.1 MB where it allocated 8.4. A handle of digits alone (a field numbered 190, say)
has no letter to look for, and is looked for as the whole of a value line: its digits with nothing but zeros, spaces and tabs before them on the line and nothing but spaces,
tabs and the end of the line after them, which a number holding the same digits (190.5, 1190) does not make, so that the records of the file that hold no such line are not
read either. Up to four such handles of three digits or more are looked for in one search; a handle of one or two digits, or more than four of digits alone, have every
record read, as before. A merge across a field numbered 700000 takes 1.3 ms where it took 3.4 on .NET Framework 4.8 (1.8 ms where it took 3.6 on .NET 10), one numbered 190
1.9 ms where it took 4.7 (1.6 where 2.8), and a text set over a cell that holds a field the same; ten such merges read 10 records group by group where they read 1 375. A table of 1 000 cells, each given its text, takes 36 ms on .NET Framework 4.8 (it took
5.3 s), 3 000 cells 0.35 s (48 s). Adding tables one after another costs the same for each: 400 tables of 3 rows and 4 columns, each cell given its text, take
0.31 s, 1 600 take 1.3 s (25 s), and a table is not counted against the entities of the drawing, which the block it was given a moment
ago cannot be named by. Copying them to another drawing (WblockCloneObjects) takes 80 ms for 400 tables whether the drawing holds
5 000 other objects or 20 000 (it took 0.98 s and 4.8 s): the names under which the named object dictionary holds each object, which
the pointers of a copied table are resolved by, are found for every object once for the call. A drawing of 100 000 entities that holds
a table pays for the copy its content is made on when it is saved after an edit, which is opened from the bytes the drawing saves as
(no string of the whole file is made of them) and in which the tables written are found in its records by handle, one pass, each given
the space of its kind (the drawing's entities are not made, nor the handle of each read): 52 ms for the 15 MB on .NET Framework 4.8
where it took 157 ms (39 ms where it took 89 on .NET 10), and 11 ms for 20 000 entities (3 MB) where it took 26. Most of what is
left of that save is the walk over the records of the copy, 22 to 25 ms for 10 MB (it was 29 to 33), which finds the word of each
record's type again by its bytes and reads a usual group code line in one pass: the first save after an edit of 100 000 lines (10
MB) with a table added after the drawing was opened takes 33 ms where it took 52 on .NET Framework 4.8 (32 where it took 34 on
.NET 10), and the first save of a drawing of 100 000 lines made in the session, with a table, 45 ms where it took 66 (71 where it took
78). The tables
written are found among the drawing's records by their type, in one walk that reads no other entity's handle, and no index of the
drawing's entities by their handle is built for the first save after an edit: 100 000 lines (10 MB) with a table take 9 ms and 40 MB
for it on .NET Framework 4.8 (9 ms on .NET 10) where they took 57 ms and 52 MB (60 ms).
The table of a block is found among the entities of the copy, as before, and a drawing whose text is not its bytes as UTF-8 (a
mark at its start, bytes read as the replacement character, a code page) makes the copy of its text.
A data link put in (SetDataLink) or taken away (RemoveDataLink) in a table read from a file is read from the cells the table keeps of
its TABLECONTENT and written by changing the cell it names, where each read the groups of the record three or four times and wrote them all
again: the links are found in the groups of the cells held (the places GroupsOf gives them), the state, the 92 and the run of the link are changed in
the groups of their own cell, and the record is written by copying the bytes of every other cell. In a table of 300 rows by 6 columns (1 800 cells, 90 000
groups in its TABLECONTENT), medians of 15 on .NET Framework 4.8 (.NET 10 in brackets), a link put in takes 2.8 ms (2.9) where it took 43.9 (31.3), a link taken
away 5.0 ms (3.0) where 54.8 (44.7) and every link 7.7 ms (2.9) where 59.0 (42.3); the first, which reads the record to keep its cells, 28.6 ms (21.9) where
56.6 (38.3), and ten put in and taken away again allocate 147 MB where 1 551 MB. A TABLECONTENT whose groups do not stand as the file writes them or that holds
extended data is read and written whole, as before. The record is read lazily: the first edit of the TABLECONTENT of a table read from a file (a merge, a row,
a link) finds where each row and cell stand from the codes of the groups and the bytes of their markers, compares each group with the bytes the file writes it
as (a value that is not a text of ASCII with no escape in it is written and compared), and makes the strings of a cell's groups only when an edit asks for them (a merge
that empties it, a link, a field): the first merge of the table of 1 800 cells takes 13.5 ms where it took 29.6 on .NET Framework 4.8 (8.4 ms where 13.3 on .NET 10),
the first row put in 14.9 ms where 32.7 (8.2 where 24.7). The groups of a table's own record that an edit changes are copied once, not twice (twenty heights of
rows set allocate 41.6 MB where 60.4), and the table's handle, asked for after an edit wrote its record anew, and the owner of a record, asked for by what the
links let go of, are read from the first groups of their records, not by a walk over every group: the handle takes 0.01 ms where it took 0.26 on .NET 10.
The links a table reads of its TABLECONTENT (what IsLinked, GetDataLink and GetDataLinkRange say, and what SetDataLink and
RemoveDataLink find first) are found where the table keeps its cells without making the strings of the groups of the cells it has not
read: each group is looked at in the bytes of the record where it stands, and a string is made of a marker, a state or a link only where one
is asked for, not of the 150 000 groups of the 1 800 cells. The first link put into the table of 300 rows by 6 columns takes 15.0 ms where
it took 28.8 on .NET Framework 4.8 (8.4 ms where 11.7 on .NET 10) and allocates 18.3 MB where 31.0 (18.0 where 27.9), and every link taken away 4.7 ms
where 14.6 (2.5 where 3.4). What was read is kept for the record it was read of, the very bytes of it, and read again when the TABLECONTENT is
written, not when the table's own record is: a height, a text or a style set in the table, which leaves its TABLECONTENT as it is, no longer
makes the next IsLinked read it again, 0.14 ms after a height where it took 14.5 on .NET Framework 4.8 for a table not linked yet and 1.6 for one whose cells are kept (0.07 ms where 5.6 and
0.95 on .NET 10); twenty heights each followed by two questions of the table allocate 59.6 MB where 336.3. The kinds of the rows, which a row put in or taken out at the
title or the header asks for, are counted from the rows the table keeps of its TABLECONTENT, from the style of each, where the record was
looked through for its TABLEROW_BEGIN; a table that does not keep its cells is looked through as before. The saved bytes, and what the
table says of its links and the kinds of its rows, are the same.
Values and their kinds
A cell's value has its kind, DataType (Long, Double or String, the value's 90 from R2007 on), what its number
measures, UnitType, and its format, Format (%lu2%pr2), each in the cell's 301 CELL_VALUE.
SetValue(row, col, 12.5) writes a number of the kind Double, its unit kept and its format taken away, as AutoCAD 2021
took a format of feet and inches away from a cell given 100.125, its text as AutoCAD writes and shows it, 12.500000, and
SetValue(row, col, 42) a whole number. A value of the flag 1 (93 of 1, 5 or 7, as AutoCAD writes a block cell's, a
formula's and an empty cell's) AutoCAD 2021 reads as none, whatever text it holds, so a text or value given to such a cell
takes the flags 6 AutoCAD writes for one it is given: the block cell made a text cell and given M16 read empty before.
From R2007 on a value or a text set gives the cell the flag of its kind of value (91 262144) where it has it not, a cell
reset, read of no value or put in, as AutoCAD 2021 gave it.
SetFormat, SetDataType (as AutoCAD 2021 turns a value: the text 12 into the whole number 12, 12.7 into 12 and -12.7
into -12, the text 12 into the number 12 shown 12.0000 in the drawing's units under %lu6 and 1e3 shown 1.0000E+03 under
%lu1, the text Parts into a number of no value, 93 7 and an empty text, each but a text of a whole number losing the
flag 2 of its value, 93 6 made 4; a unit of several flags as Angle | AngleNotTransformed, 65 538, written as it is; a
kind other than a text, a whole number and a number refused, the library knowing no groups for it) and
ResetValue write the rest, in the cell's value: none of them sets a flag of the cell's overrides, so GetOverrides
gives what it gave, but for a block cell given a format, which loses its flag 0x40000. SetFormat writes a number's text anew by a format of units, %lu and its unit
1 to 6 with %prN for its places and %zs for its zeros: 12.5 under %lu4%pr2 is 1'-0 1/2", to the nearest 1/2^N of an
inch, a half away from nought, -0.25 -0'-0 1/4" and -0.001 0'-0", %zs1 leaving nought feet out (7 1/4") and %zs2 nought
inches (1'), as AutoCAD 2021 wrote them. The unit 6 is the drawing's (LUNITS) and a format with no %prN takes the drawing's
places (LUPREC), as AutoCAD 2021 showed them: 12.3456 under %lu6%pr2 is 1'-0.35" at LUNITS 3 and 1.23E+01 at LUNITS 1, under
%lu3%pr0 1'-0", under %lu1%pr0 1E+01, under %lu5%pr2 12 1/4, and under %lu4 at LUPREC 2 1'-0 1/4"; feet and decimals of
an inch (%lu3) take %zs1 and %zs2 as feet and fractions do, -0.5 under %lu3%pr2%zs1 -0.50" and 11.99999 under %lu3%zs2 1';
it leaves the text as it is under a format of no units, and for a number of more
feet than 32 bits hold, which AutoCAD writes as garbage or in powers of ten. A date keeps its format and shows in it (see
the dates below). Only a number or a date keeps a format: a whole
number, a text or a value of another kind given one is written with none, 7 given %lu2%pr2 still shown 7; a value of
none becomes the empty one of no kind (93 5, 90 512), even for an empty format; a block cell keeps none and loses its
flag 0x40000; and each value given a format loses the flag 2 of its value (93 6 made 4), as AutoCAD 2021 wrote them.
ResetValue leaves a value of none (93 7, 90 0, the
cell's flag 0x40000 taken out), as AutoCAD 2021 wrote it and read it as of no kind, and takes the looks of the content
with it: the cell's own text style, text height and colour (7, 140, 64), but those alike the table's own looks of its
row's kind, and its turn (145 made nought), its alignment, background and lines kept. B-12 of GH_TXT, 5 high, red, turned
90 degrees, bottom right on green keeps bottom right on green; in a table of its own data of 9, GH_TXT, red and top left
it keeps those, which ClearTableStyleOverrides(1) then takes away with the table's while the drawing is open, and which
ClearTableStyleOverrides of 0 or 2 leaves the value 93 7, 90 0 it was given, as AutoCAD 2021 did. A block cell reset
becomes a text cell of no value (91 0, 93 7, 90 0), its block gone, as AutoCAD 2021 emptied the block cell M12; the
library refused it before. From R2007 on, SetTextString of an empty text does what ResetValue does, as AutoCAD 2021
wrote it: B-12, 1.5 or the empty text of the title's hidden cell given "" are of no value, where the library wrote an
empty text. A cell of a file before R2007 holds its
text alone, so a value set there is written as its text, a number as the invariant culture writes it (12.5, whole), and
reads back as one, and a kind or a format other than a text and none is refused. A date or a point is refused as a value of
SetValue; a date typed in the presenter is written as AutoCAD 2021 wrote one (the dates below).
A date a cell holds is the kind 8 with 92 16 and a 310 of 16 bytes, a SYSTEMTIME of its year, month, day of the week
from Sunday, day, hour, minute, second and thousandths, each two bytes with the low first: 1/1/2020 is
E4070100030001000000000000000000, 12:30 (a time on 30 December 1899) 6B070C0006001E000C001E0000000000 and 1/1/2020 12:30
E4070100030001000C001E0000000000. A cell of no kind given the words 1/1/2020, 12:30 or 1/1/2020 12:30 takes the format
%x (a date, or a time of midnight, which is the date 12/30/1899), %X (a time) or %c (both), the flags 4 and no
alignment of its own, and shows the words in the machine's culture, as the C library's strftime does under a format of
letters (%d/%m/%Y, %A, %B, %H:%M, %I:%M %p, %C, %h, %F, %r as %X, %u from 1 on a Monday to 7 on a
Sunday, %z and %Z the machine's zone as +0700 and its daylight name, M/d/yyyy), the date under none or under a letter AutoCAD
gets wrong (%j is 001 for every date it reads, %U and %W 01 on a Sunday or a Monday and 00 on any other day, and %V, %G and
%g follow); the editor opens it as the date alone,
the time alone or both whatever the format. A text typed over a date is refused (eInvalidInput) unless it is a date or a time,
which keeps the cell's format. The library reads the words as AutoCAD's OLE parser does in en-US, with the order of the
culture given (DxfTableDate.TryRead): 12:30:45.5, a weekday, a zone, 2/30/2020, 24:00 and a year before 100 stay words, as does 12:30 p, which AutoCAD reads. Value of a date or a time is the DateTime AutoCAD 2021 gave (1/1/2020 12:30 the 1st of January 2020 at 12:30, 12:30 alone the 30th of December 1899), where it gave the words before. The look of a cell is set as its own
override with its flag in the cell's 177 (91 from R2007 on), in the order the DXF reference lists them: SetAlignment,
SetTextHeight, SetTextStyle, SetContentColor, SetBackgroundColor (a colour of the index, BYLAYER or BYBLOCK; a
true colour refused) and SetBackgroundColorNone, a background filled written 283 0 with a colour of its own (63 0,
BYBLOCK, where the cell has none) and one unfilled 283 1, or no override at all where its row's kind is unfilled, as
AutoCAD 2021 writes and reads them; SetTextRotation and SetRotation write a cell's turn (145), SetAutoScale a
block cell's fitting (174), and SetCellType makes a block cell a text cell of no value, its block and attribute values
taken out. An override the cell has already is written in its place, before the cell's 92 where AutoCAD 2021
writes its own (170 5, 7 GH_TXT, 140 3.5): SetTextStyle of such a cell wrote a second 7 after its value, which
AutoCAD read and the library did not. From R2007 on a cell's overrides set are all written there, in AutoCAD's order
(170, 7, 63, 64, 283, 140, then the right, bottom, left and top edge, each its lineweight, showing and colour), those it
held after its value moved with them; before R2007 after its text, where AutoCAD writes them. GetOverrides gives what a
cell holds of its own as AutoCAD's CellProperties, its flag of its kind of value (0x40000) as DataType | DataFormat,
as AutoCAD 2021 reads that flag from a file; SetOverrides gives it those named as AutoCAD 2021 gives them, its
flags exactly those, its alignment and background kept whatever is named, one it has not given the value AutoCAD gives
(the alignment its row shows, a background of none, the colour by block, the text height 0.18 of the content's own format,
a text style of none), its colour, text style, height and kind of value not named taken away, so that the cell takes them
from its table style: Qty given TextHeight is written 91 32, 140 0.18. RemoveAllOverrides takes them
all, wherever they stand outside the cell's value, and the edges of its lines from its edge flags (172), as AutoCAD
2021's own took 170 5, 7 GH_TXT and 140 3.5 out from before the 92 of its cell (1, 0) and wrote a cell of 172 9
as 172 0, both keeping the cell's own kind of value (its flag 0x40000), for which the library knows no groups, but in a
block cell, which loses it; it also turns the cell's text or block back to nought (145), and a cell of a row of the
title's or the header's kind out of its place keeps the looks of its kind (170 5, 140 6.0 in the title moved down by a
row put in before it, and in a row put in that takes the title's look, the title shown), as AutoCAD 2021 wrote them; and
TableStyleOverrides and ClearTableStyleOverrides read and take away the table's own (its flags 93 to 96 and the
groups after its last cell, or in its head after those flags and before its heights, where AutoCAD 2021 writes them),
in one pass over the table's groups: the cells of a table of 16 001 rows of 2 columns, half
of them of three overrides, are cleared in 0.19 s, where taking each group out on its own took 6.6 s.
Clearing overrides
ClearTableStyleOverrides of 0 or 2 leaves each cell of no value the empty value of no kind (93 5, 90 512) and each
block cell without its flag 0x40000, and of 2 gives each cell the table's own looks of its row's kind as its own, as
AutoCAD 2021 wrote them, so that a table of its own data of 9, GH_TXT, red and top left still shows them in each cell. A
cell emptied while the drawing is open keeps its 93 7, 90 0, wherever rows or columns put in or taken out moved it
since, as AutoCAD 2021 kept it: one reset or given an empty text, one put in by InsertRows, InsertColumns or
SetSize, and one a merge emptied, the merge made on load among them; the table given a row before its row 2 and
cleared of 0 writes 93 7 in both cells of the new row, and 93 5, 90 512 in a cell read of no value from the file.
A clear of any option leaves the title and the header left out as they are (280, 281 and bits 0 and 1 of 93); of 0 and 2
it turns each cell's text and block back to nought (145), and gives a cell of a row of the title's or the header's kind
out of its place the looks of its kind, as AutoCAD 2021 did: the table given a row before its title and cleared of 0
writes 93 3, 280 1, 281 1, its title cells 170 5 and 140 6.0 and its header cells 170 5, and AutoCAD then
merges the new first row on load as it merges its own. AutoCAD keeps the table's own looks of the data with each row of
data, so that a row put in before the first row of data, which takes them from the table and gives them to the old rows'
cells, leaves them with those rows while the drawing is open: a clear of 2 and RemoveAllOverrides give B-12 and M12
back GH_TXT, red, 9 and top left, wherever the rows went since, and a clear of 0 or 1 takes them from the rows with the
table's own. AutoCAD keeps the looks of every row with the row, and reads the table's own looks of a kind from its first
row of that kind; the library follows the rows the same way while the drawing is open. A row InsertRows or SetSize
puts in keeps none, so that the table of its own data looks given a row after B-12 and cleared of 2 writes the new row's
cells 91 0; a row InsertRowsAndInherit puts in keeps those of the row whose look it takes; and where DeleteRows
takes out the first row of data, the table's own looks of the data are those of the next: the row put in at 0 taken out
again gives the table its looks back as they were (93 6886016), and B-12 taken out after a row put in after it leaves
it none. The kinds of the rows are read from the TABLECONTENT once for each writing of it (from the rows the table keeps of it where it keeps them), and only where it holds
more rows of the title's or the header's style than the table shows: a clear of a table of 400 rows takes as long as it
did before the kinds were read, and taking away the overrides of its cells one by one too.
Walking and setting cells
The cells are
walked row by row (foreach (DxfCell cell in table)), and table.Cells[1, 0] is a DxfCell that reads and sets one,
cell.TextString = "Count", cell.Alignment = DxfCellAlignment.MiddleCenter; table.Rows[0].Height and
table.Columns[1].Width are read and set, and the block of merged cells GetMergeRange(0, 1) gives reads its cells,
range[0, 0].TextString. HitTest(point, viewVector) gives the cell a point hits, carried along the direction it is
seen in onto the table's plane, on a table turned or mirrored as on a flat one: on the table of columns 40 and 30 wide
and rows 10, 8 and 8 high at (300, -100, 0), (350, -112, 5) seen from above hits the cell (1, 1). AttachmentPoint is
where a cell's content is placed, in from its sides by the margins as its alignment says, AutoCAD's STANDARD style's
alignment taken where the cell has none of its own: the header cell (1, 1) is placed at (355, -114, 0). A cell of a
block of merged cells is placed by the block's top left cell, which holds its content, and the top is the cell's top as
it is seen whichever way the rows flow: with the rows of that table flowing up, the cell (2, 0), from y -82 to -74, is
placed at the top middle at (320, -74.06, 0). None of these draws the table's block anew. What a file of these versions
has no group for is not there: a cell's state, tooltip, cell style, margins of its own, content layout, custom data and
merging of all, and a column's name; nor are the forms by row type (SetAlignment(align, rowTypes) and the like), whose
groups after the last cell the DXF reference lists without their order.
Changing the structure
A table's structure changes as AutoCAD's does, each change written in one writing of its record, its block left for
AutoCAD to draw anew. InsertRows(row, height, rows) and InsertColumns(col, width, columns) put in rows and columns
of empty text cells, written in the form of the file (text in 1 before R2007, from R2007 on a 301 CELL_VALUE of no
value, 93 7 and 90 0, as AutoCAD 2021 writes a new cell and reads as of no value), with
their counts (91, 92) and heights and widths (141, 142), written as reals as AutoCAD 2021 writes every real of a table (141 9.0 for a row 9 high, 142 20.0 for a column 20 wide): the table of rows 10, 8 and 8 given two rows 6 high before its
row 2 has rows 10, 8, 6, 6 and 8, and a column 25 wide put in before its column 1 grows the title merged across it to
three columns; so does one put in before column 0 or after the last, Parts kept in (0, 0), as AutoCAD 2021 grows a
title merged across the table, where a merge of another row moves on with its columns. A column put in before the
title's first column or after its last merges the title anew, as AutoCAD 2021 merged it: its other cells emptied, of no
value, under its top line, and the line under the title its bottom line across every column, a green line under Qty
made the yellow of the line under Mark; one put in among its columns grows it as it is. A row put in before the title or
the header is of data, as AutoCAD 2021 keeps it: the record tells a row's kind by its place alone, so the table leaves
the title out (280 1) or the header (281 1), and the title or header moved down, read as data, takes as its own the looks
of its kind the data's are not (170 5 and 140 6.0 for the title of AutoCAD's Standard, 170 5 for the header) and
the table's own of its kind; a row put in at or before the first row of data takes the table's own looks of the data
away from it, the rows of data given them as their own, as AutoCAD reads them from its first row of data. AutoCAD keeps a
kind with each row, the style of its row in the TABLECONTENT (1 the title, 2 the header, 3 data), and the library reads
it there: the title moved down by a row put in before it is the title again once that row is taken out. The first row put
into a table of one row is the header, wherever it goes, and the rest of data, as AutoCAD 2021 gave them: the table of
its title alone given two rows by SetSize or InsertRows has its header shown again (no 281), whether it was left out
by the rows taken or by IsHeaderSuppressed, and a row put after a lone row of data is a header out of its place, read
as data with the header's 170 5. InsertRowsAndInherit and
InsertColumnsAndInherit give the new cells the look of a row or column (the overrides with their flags, the turn, and
from R2007 on the kind, unit and format of the value, its empty value 93 5 as AutoCAD writes it, of the kind 512 for
a value of no kind), wherever its overrides stand, with the edges of its lines (172), every line of it, rows and columns
alike: the row put in under a cell whose top and left are red has its top and left red, so that the line between them
reads red, as AutoCAD 2021 wrote it; not its content. A block of merged cells along that row or column is merged along
each new one, the title's too, and a new row of the title's or the header's look is of that kind, its cells given the
looks of the kind as a title moved down is, unless it goes in the kind's place: from the title before the header, the
new row merged across and 6 high, read as data, and the header left out. A new cell of a column InsertColumns or SetSize puts in takes as its own the looks its row keeps
(alignment, text style, background, colour, text height): AutoCAD 2021 gave the new header cell of
a table of its own header of 9 140 9.0 with its flag 0x20, and read a cell without them by its table style alone,
4.5; a new row's cells it gave none. A row of the title's or the header's kind out of its place gives its new cell the
looks of its kind, the title moved down 170 5 and 140 6.0, and a row put in gives its new cell none. DeleteRows
and DeleteColumns take them out, a block of merged cells shrunk to what is left of it and unmerged where one cell is
left, each cell left keeping its own content, empty where MergeCells emptied it, as AutoCAD 2021 left them: the title
of two columns that loses its first keeps the empty text of its second, not Parts. Taking out the title or the header
leaves it out (280 1 or 281 1, the header first and shown where the title goes), and the table's own looks of a kind
of which no row is left go from its head with their flags, the header's background with the header, the data's text
style with the last row of data. The first edit of a table while its drawing is open, whatever it is (a value, a look, a
row, a fill, a move, or its own colour, layer, linetype, lineweight, linetype scale, visibility or transparency as an
entity), merges across the table first the rows AutoCAD 2021 merges when it loads a file, as MergeCells
merges them, and writes them so, as AutoCAD writes them whenever it saves the drawing: the first row, whatever its kind
and whether the title is shown, and any other row of the title's kind, where no block of merged cells reaches out of it
and every cell after the block of its first cell is a text cell of no value or of an empty text, whatever its colour,
background or alignment. The title Parts unmerged over an empty cell comes out merged across the table; one with X, a
space or nought beside it, a block, or a block merged down from it, stays as it is. Later edits merge nothing: a title
unmerged and given X beside Parts stays unmerged. A table read and not edited is written as it was read. The hidden
cell of a row of the title's kind moved down keeps the title's looks, 140 6.0 of AutoCAD's Standard, and is given them
where it held a height of its own, as AutoCAD 2021 kept them.
Resizing
SetSize(numRows, numCols) cuts or carries on the table from its bottom and right, the new rows 4/3 of the text
height the table style gives the data and twice the margin above and below (9 for AutoCAD's Standard of 4.5 and 1.5,
6.333 for a style of 2.5, 12 for the table's own margin of 3, whatever the rows above) and the new columns as wide as
AutoCAD 2021 makes them, the text height of the first row whose new cell is merged
with none and the margins either side: the header's 4.5 and 1.5 of AutoCAD's Standard, 7.5, under a title merged across
the table, which grows over them; the title's 6, 9 wide, where it is unmerged; 1 wide in a table of one row under its
title merged across it, which has no row whose new cell is merged with none. No other block grows with columns or rows
put in after it: a title merged across some of the columns, or a column merged down to the last row, stays as it is, and
grows only by rows or columns put in among it, as AutoCAD 2021 left them; CanInsertRow, CanInsertColumn, CanDeleteRows and CanDeleteColumns say whether they can, one row and one
column at least kept. 16 000 rows go in or out in about 0.3 s on .NET 10, as one setter of a cell takes.
Merging
MergeCells(range) gives the top left cell of the range the width and height of the block (175, 176) and 173 0, and
marks the others merged (173 of 1), as AutoCAD 2021 writes them, a block within the range taken into it and one across
its edge refused, and UnmergeCells takes back each block the range meets, its top left cell given 175 1 and 176 1,
as AutoCAD writes a cell of no block and each new cell of a row or column put in. The other cells of the block are
emptied as AutoCAD 2021 empties them: text cells of
no value, no block, their text style, height and colour of their own taken away unless they are the table's own looks
of their row's kind, their alignment and background kept, and in the TABLECONTENT of no content (95 0); the edges of
the block take the lines of its corners, its top and left the top left cell's, its right the top right cell's and its
bottom the bottom left cell's, so that a green line over Qty goes where the line over Mark is none, and the lines within
it stay. A block is read from those spans of its top left cell alone, as AutoCAD 2021 reads
it: AutoCAD writes that cell 173 0 and the others of the block 173 1, and read a 173 1 in a cell of no spans as no
merge. The edges of a cell are its own overrides: SetGridColor(row, column, gridLineType, color), SetGridLineWeight, SetGridVisibility and SetGridProperty write its top, right, bottom and left colours
(69, 65, 66, 68), lineweights (279, 275, 276, 278) and showing (289, 285, 286, 288) with their flags, and the edge in
the cell's edge flags (172: 1 top, 2 right, 4 bottom, 8 left), without which AutoCAD 2021 reads no line of a cell
wherever its group stands, and
SetGridProperty(range, ...) the lines of a block, those inside on the cells either side of each line. A line between
two cells is one line, the edge of one cell: AutoCAD 2021 writes it as the top or left of the cell below or right of it,
and reads it from that cell where the cell holds the edge (its edge flag and one of the edge's overrides at least), else
from the bottom or right of the other where that one holds it, each property of the line from the edge that holds it.
Grid lines
So GetGridColor, GetGridLineWeight, GetGridVisibility, GetGridProperty and GridColor(row, col, edge) read the
bottom of (1, 1) as the top of (2, 1) where (2, 1) holds its top, green there and red in (1, 1) reading green, and the
top of (2, 1) of a colour alone with the bottom of (1, 1) of a lineweight alone reading no lineweight; null where no edge
holds the line. The bottom or right of a cell set is set on the cell below or right of it too where that one holds the
line, and a top or left set that the cell does not hold takes first the properties the cell above or left of it gives
the line, so that a line set reads as set and keeps what was not set. The showing is 0 hidden and any other drawn, as
AutoCAD 2021 read it (its own DXF writes 1 for a line it hides, which it reads back drawn). GridColor(gridlineType, rowType) and its setter SetGridColor(color, borders, rows), with the lineweights and showing alike, read and write
the table's own lines of the title, the header or the data, with their flags in 94, 95 and 96, the groups of a code in
the order of their flags and after the table's colours of its rows: written in its head after its flags, where AutoCAD
2021 writes them and reads them onto each cell of the kind (it read those after the last cell as none), and after the
last cell only where the table holds its own there already; HorizontalCellMargin, VerticalCellMargin, IsTitleSuppressed,
IsHeaderSuppressed and FlowDirection read the table's own there too (93 8 ... 96 0, 40 3.0 before its
heights), and a table scaled scales the text heights it gives its rows there. A table of no margin of its own takes its
style's (the TABLESTYLE's 40 and 41), else that of AutoCAD's own Standard, 1.5 in a drawing of millimetres and 0.06 in
one of inches, as AutoCAD 2021 reads it, read from the style once and kept until the drawing is changed. A table leaves
its title or its header out where its own 280 or 281 says so or its style's does (DxfTableStyle.IsTitleSuppressed), as
AutoCAD 2021 read it: a table of four rows of no flag of its own in a style that leaves the title out has its first row
the header and the rest data (RowType, and the cell styles _HEADER and _DATA AutoCAD gave them), drawn by
RecomputeTableBlock in the header's and the data's looks; one of its own 93 1, 280 0 in that style was read the
same, without its title, so a table's own 0 does not show what its style leaves out. SetFormula(row, column, 0, "=A2+B2"), from R2004 on,
adds a FIELD of AutoCAD's expressions (AcExpr, field code \AcExpr (A2+B2)) owned by the table, written as DxfField
writes one with the class FIELD listed, and points the cell's 344 at it, after its turn (145) and before its 92, as
AutoCAD 2021 wrote one, its value left for AutoCAD to work out; a field
a cell lets go of, by a text, a value or a formula set, by its row or column taken out or by a copy or a fill over it,
is erased with its children where the table owns it and nothing else of the file points at it (a copy of the table,
which holds its original's fields, an XRECORD, another field), and taken out of the drawing's ACAD_FIELDLIST; a field
kept whose owner goes is given to a field that names it, else to the table. A copy of a table in its own drawing shares
the original's fields: erasing the original table leaves the copy's 344s naming nothing, a limit listed for later;
Formulas
GetFormula and HasFormula read one back, or one AutoCAD wrote as a field of text holding it, from the cell's field in
the table's TABLECONTENT where the cell's 344 names no record, as AutoCAD 2021 wrote the formula of a linked cell; the
link taken away, such a formula is written in the cell's own FIELD, as AutoCAD read none there until the cell had one. CopyFrom(source, options, sourceRange, targetRange) copies cells of a table of the same drawing, content, look and merges, growing the
table with ExpandOrContractTable, which never shrinks it (a copy past the last row of the header and data rows makes
the table of 3 rows one of 5), the content alone with SkipFormat, the look alone with SkipContent; a cell's field is
not copied, and the other options are refused. A cell emptied while the drawing is open (reset, given an empty text, put
in, or emptied by a merge) holds no content to give, as AutoCAD 2021 copied and filled from one: CopyFrom, and Fill
with CopyContent, leave the target's content as it was, Z staying Z, and a format copied gives it the cell's own look
alone (alignment, background, lines), the target keeping its text style, height, colour and kind of value; one read of no
value from the file is copied as none. With GenerateSeries a source of no value of either kind gives the target none of
no kind (91 0). A cell given a content by a copy or a fill is no longer one emptied in the session, so a clear writes
one given none as one read so (93 5, 90 512). Fill(fillRange, sourceRange, options) fills the rows of the fill range
down the source's columns (or its columns along the source's rows with Row), as AutoCAD 2021 fills them: each cell the
source cell its place repeats from the fill range's first cell; above (or left of) the source and longer than it, back
from the fill range's last cell, the source's last next to it, 2.5 and 3.5 into rows 10 to 12 giving 3.5, 2.5 and 3.5,
in whole lengths of the source, the cells of one that would reach before the table's first row or column left as they
are (four sources from column 7 into columns 0 to 6 fill 3 to 6 alone); a cell a merge hides is left as it is too, the
title's second cell filled from Parts staying empty; CopyContent the content alone, winning over a series,
CopyFormat the look and kind alone (a cell of no value given one of none of that kind, one of a value of another kind
turned into it as SetDataType turns it, the text 12 under the look of 1.5 the number 12 shown 12.0000), both the cell
whole, into the header and the title as into rows of data;
Filling a series
GenerateSeries carries the numbers on from the source's last, wherever the fill range stands, 10 and 20 to 30 and 40,
each rounded to the places of the source and the step, to 15 figures (0.1 and 0.2 to 0.3, shown 0.300000; 1, 2 and 4 to
5.5 and 7), and with Reverse back from the source's first, the fill range's last cell next to it, 10 and 20 to -20, -10
and 0. Each number is written in the format of the source cell its place repeats, and shown in it, the target's own
format giving way, as AutoCAD 2021 fills them: 1.5 of %lu6 goes on to 2.5000 and 3.5000 at LUPREC 4, and 1/2 of %lu5
over 1.5 of %lu6 to 2 1/2, 3.5000, 4 1/2 and 5.5000; a source of no format still gives six places. Options of none of
the three change nothing, and a fill range that holds a cell of the source is refused, as
AutoCAD refuses it; a text is a number only before R2007, and a series of dates goes on as the dates above do (Fill with GenerateSeries: from the last date by the step between the last two, a day for one, in seconds as the C library's mktime counts them, the machine's zone taken off the date as shown and not put back, so that 1/1/2020 filled into three cells has the values 1/1/2020 17:00, 1/2/2020 17:00 and 1/3/2020 17:00 (shown 1/1/2020, 1/2/2020 and 1/3/2020) seven hours ahead of Greenwich; in reverse back from the first by the step between the first two; a date before the epoch counts as -1, and one the series cannot make is a date of 16 bytes of nought and no words; dates mixed with other values are copied). The value of each cell filled so is written with the flags 4 (93 4) that a filled number has: AutoCAD 2021's API, which is all its console gives of a cell, shows a filled date with the kind, format, text and state of a typed one, as it shows a filled number, and does not give the flags themselves.
SetFromStyle() takes the table's and its cells' overrides away, as ClearTableStyleOverrides(0) does. What a file of
these versions has no group for is not there: several contents in one cell, and a line's style, linetype and the spacing
of a double line.
Links to data
A range of a table's cells is linked to data as AutoCAD links one to a spreadsheet, from R2007 on; the library reads
such links, takes them away and puts them in. A DxfDataLink is a DATALINK of the drawing's
DataLinkDictionary (ACAD_DATALINK), read with its DataAdapterId (AcExcel), ConnectionString
(parts.xlsx!Sheet1!A1:B2), Description, ToolTip, DataLinkOption, UpdateOption, IsValid and
GetUpdateStatus; its Name set renames its entry. AutoCAD 2021 names a link in the TABLECONTENT it keeps for the table,
which the table's extension dictionary holds under ACAD_XREC_ROUNDTRIP through an XRECORD of
ACAD_ROUNDTRIP_2008_TABLE_ENTITY: the range's top left cell there has its 92 odd after its custom data, then the
DATALINK's handle (340), the range's rows (93) and columns (94) and a 96, and its state (90) the flag 4 of a linked cell;
the ACAD_TABLE's own cells name no link. GetDataLink and GetDataLinkRange read it from every cell of the range, and
IsLinked is true at its top left cell, whatever its state, at any other cell of it whose state in the TABLECONTENT
has the flag 4, and at any other AutoCAD lays out from the ACAD_TABLE: its cell of the TABLECONTENT holding no content,
or one whose checksum disagrees with the cell's text in the ACAD_TABLE. AutoCAD 2021 read its own range (1, 0) to (2, 1),
whose other cells held an empty value of the checksum of their text, linked at (1, 0) alone, each cell giving the range
and the link, and at (2, 1) too once its state was given the flag 4; the library's range of cells of no content it read
linked at all four; a text, a number or an empty value of an agreeing checksum not linked, of a disagreeing one linked. A
table the drawing's ACDB_RECOMPOSE_DATA does not list has no link of its TABLECONTENT, as AutoCAD read none of its own
73 with that record listing its style alone or nothing, and SetDataLink lists it; a cell of
the flag 4 in no range is linked where it holds a content (its 95 above nought), with no range and no link, as AutoCAD read
the title (0, 0) of Parts and a cell of data (2, 1) of no text given it beside a range over (1, 0) to (1, 1), and not
where it holds none, as AutoCAD read (0, 1) given it beside the range of (1, 0) to (2, 1); a cell of the TABLECONTENT is taken as the
table's of its row and column whatever rows the TABLECONTENT has, as AutoCAD
2021 read the link of (1, 0) of a table given a fourth row by a program that left its TABLECONTENT of three: AutoCAD's table
linked over (1, 0) to (2, 1), which it read back as (1, 0) alone, gives (1, 0) to (1, 0), and link.GetTargets() gives the
table. SetDataLink(row, column, link) and SetDataLink(range, link) put a link in as AutoCAD 2021's does, to a DATALINK
of the drawing: the range's top left cell of the TABLECONTENT given the flag 4, its 92 made odd and 340 link, 93 rows,
94 columns, 96 1 after it, and the DATALINK tied to the table and its TABLECONTENT (94 2, 330 F6, 330 187). The
cells keep what they hold until AutoCAD updates the link; a range that meets a linked one is refused. A table of no
TABLECONTENT, as a program other than AutoCAD writes one, is given one from R2007 on, as AutoCAD 2021 gave the ezdxf table
of its 73 one: an XRECORD of ACAD_ROUNDTRIP_2008_TABLE_ENTITY under ACAD_XREC_ROUNDTRIP in the table's extension
dictionary, the TABLECONTENT of the table's columns and rows, each cell of no content and of the checksum of its text, its
merged cells and its style, the table and its style listed in ACDB_RECOMPOSE_DATA, without which AutoCAD reads no
TABLECONTENT at all, and the class TABLECONTENT; no TABLEGEOMETRY, as AutoCAD read its own 73 without one. AutoCAD 2021
read the library's link of (1, 0) so made, in R2018 and R2007, and a range of more cells linked at every cell, as the
library reads it. A drawing before R2007 holds no TABLECONTENT,
and its table is not linked. RemoveDataLink takes the links
away as AutoCAD 2021's does: the TABLECONTENT's cell made unlinked in place (92 even, the run out, the flag 4 cleared from
it and from every other cell of its range, as AutoCAD read a cell of the range left with it as linked with no range and
saved it so; a cell of the flag 4 outside every range is left as it is), the DATALINK left in the drawing, named or Anonymous, the table and what it owns taken out of the objects it lists
itself tied to (94 2, 330 F6, 330 149 comes out 94 0). Rows and columns put in or taken out are put in and taken
out of the TABLECONTENT too, as AutoCAD 2021's own InsertRows, DeleteRows, InsertColumns, DeleteColumns and
SetSize write them: AutoCAD reads the links, the style of each row (title, header or data) and the borders of the cells
from the TABLECONTENT, cell by cell, so a row put in above AutoCAD's link at (1, 0) left in a TABLECONTENT of the old rows
was read linked at the new row, and a row of data moved up into the header's place read as a header. Each new row is one
of data of empty cells (of the style of the row whose look it takes with InsertRowsAndInherit, each cell then of the
format of that row's cell, its margins and lines, and of an empty value of the flags 5 where that cell holds a content,
as AutoCAD 2021 wrote them), each new column of the
width given, the heights and widths written as reals (40 10.0) as AutoCAD writes them; a link moves with its cell and
grows or shrinks as the table's merged cells do, and goes with its cell, its DATALINK then no longer tied to the
TABLECONTENT, the table kept among its targets, as AutoCAD wrote it (94 1, 330 F6); a field a cell taken out held
(AutoCAD's formula of a linked cell) goes out of the list after the rows (92 1, 360 192 comes out 92 0) and is
erased where nothing left holds it. The merged cells the TABLECONTENT lists move with its rows, and MergeCells and UnmergeCells list them so,
though AutoCAD reads a table's merges, as its text, values and formats, from the ACAD_TABLE. A TABLECONTENT of fewer rows
than its table, as a program left one, gets no row past its last, and one past the table's last row or column names
none. The library reads no
spreadsheet: the cells keep what they hold, and UpdateDataLink is not there.
A link named in a cell of the ACAD_TABLE, the run 340, 93, 94, 96 straight after the cell's 92 made odd, is read as well:
it was the library's guess, which AutoCAD reads no link from, and which makes AutoCAD read the cells after it awry; every
cell of its range is IsLinked, as before. Only a text cell names a link so: a block cell's 340 names its block, whatever its 92. Rows and columns put in and taken out,
SetSize and CopyFrom move, grow and shrink such a range as they do a block of merged cells, CopyFrom bringing the
links wholly within its source unless SkipDataLink is given, and a cell filled from a linked one is not linked. A link
whose rows or columns are all taken out goes with them, and its DATALINK, with what it owns, where its DataLinkOption is
Anonymous and nothing else of the file points at it (another table, a copy of this one), the dictionary that holds it
aside.
A DxfDataLink is neither made in code nor has its groups set (Checking against AutoCAD,
points 73 to 78). The DXF reference describes no DATALINK and ezdxf keeps one as it reads it; the groups read
are those LibreDWG and AutoCAD 2021 give, which have no 70, the count of the objects the link is tied to (94) with a 330
each, what it owns (360) and its custom data between 305 CUSTOMDATA, 1 DATAMAP_BEGIN and 309 DATAMAP_END. An UpdateOption of 1 179 649, as LibreDWG's example gives
it, is SkipFormat (0x20000) and AllowSourceUpdate (0x100000), which make 1 179 648, and a 0x1 no flag of AutoCAD's
UpdateOption explains. The breaking of a table into parts (BreakEnabled and the rest) is not there either: its
groups are in no reference.