Method SetFormula
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
SetFormula(int, int, int, string)
Sets the formula of a cell, as AutoCAD's SetFormula, from R2004 on, which brought fields: a FIELD added at the
end of the OBJECTS section, owned by
the table, of the evaluator AcExpr and the field code \AcExpr (A1+B1) for =A1+B1, written as
DxfField writes a field made in code (marked not yet worked out, its status 95 of 1), the class FIELD
listed in the CLASSES section where it is not, and the cell's 344 pointed at it. The cell's value is left as it is,
for AutoCAD to work out when it evaluates the field; the field the cell pointed at before is erased with its
children where the table owns it and nothing else of the file points at it. Nothing is written where the cell holds
that formula. The block AutoCAD drew the table with is not drawn anew.
public void SetFormula(int row, int column, int contentIndex, string formula)
Parameters
rowintThe row, from nought.
columnintThe column, from nought.
contentIndexintThe content, nought.
formulastringThe formula, from its
=:=Sum(A1:B2).
Exceptions
- ArgumentNullException
Thrown when the formula is null.
- ArgumentOutOfRangeException
Thrown when the cell is not one of the table's, or the content is not nought.
- ArgumentException
Thrown when the formula does not begin with
=, has nothing after it, has a line break in it, or would not be read back as it is given, its parentheses not paired.- InvalidOperationException
Thrown when the cell is a block cell, the file is older than R2004 (AC1018), which brought fields, or the table is erased.