Table of Contents

Method SetFormat

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

SetFormat(int, int, string)

Sets the format of a cell's value, as AutoCAD's SetFormat(row, col, format): its value's 300, as AutoCAD writes it, %lu2%pr2 for a decimal of two places, the value kept; the text of a number of its kind Double written as AutoCAD 2021 wrote it, of the places a decimal format gives, 12.500 for %lu2%pr3, in feet and inches for an architectural format, 1'-0 1/2" for 12.5 in %lu4%pr2 (D33 u1 to u8; to the nearest 1/2^N of an inch, %zs1 and %zs2 leaving out nought feet and nought inches), and in the other units as AutoCAD 2021 showed them (T1 to T4): %lu1 powers of ten, 1.23E+01 for 12.3456 of %lu1%pr2, %lu3 feet and decimals of an inch, 1'-0.35" of %lu3%pr2 (with %zs1 and %zs2 as for feet and fractions) and %lu5 fractions, 12 1/4 of %lu5%pr2; %lu6 takes the drawing's units (LUNITS), and a format of no %prN the drawing's places (LUPREC); of six places where the format is taken away (D28e v11), any other text kept, the library not formatting the value of a format of another kind, nor one of more feet than 32 bits hold. A date keeps its format and shows in it, as Text(DateTime, string, CultureInfo) shows it (D41). The value loses its flag 2 (93 6 made 4), as AutoCAD 2021 wrote it. Only a number keeps a format: a whole number, a text or a value of another kind is written with none and its flag 2 taken away, the 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 no format and loses the flag of its kind of value (0x40000) alone (D33b s01 to s19). No other flag of the cell's overrides is set, and GetOverrides(int, int, int) gives what it gave. A cell before R2007 holds no value to give a format.

public void SetFormat(int row, int col, string format)

Parameters

row int

The row, from nought.

col int

The column, from nought.

format string

The format; empty for none.

Exceptions

ArgumentNullException

Thrown when the format is null.

ArgumentOutOfRangeException

Thrown when the cell is not one of the table's.

ArgumentException

Thrown when the format has a line break in it.

InvalidOperationException

Thrown when the cell holds its text alone, as a file before R2007 writes it, or the table is erased.