Method AddContext
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
AddContext(DxfObjectContext)
Adds a scale made in code to the list, as AutoCAD's AddContext: a SCALE at the end of the OBJECTS section, owned
by ACAD_SCALELIST and named in it as AutoCAD 2021 names one, *A and one more than the highest number of such a
name the list has or was given while the drawing is open: Z1, Z2 and Z3 added are *A1, *A2 and
*A3, and Z4 added once Z3 is taken out is *A4 (check D35e). Its name (300), units (140, 141) and the
flag of the unit scale (290) are written as AutoCAD writes them, the flag 1 for a scale of as many units
of the paper as of the drawing, 1:1, where the list has no unit scale, as AutoCAD keeps one, else 0; the class SCALE listed in the
CLASSES section where it is not. The dictionary ACAD_SCALELIST is added to the named object dictionary where it has
none, in a file of R2007 (AC1021) or later, the version of AutoCAD 2008, which brought the list. The scale stands for
its SCALE from then on.
public void AddContext(DxfObjectContext context)
Parameters
contextDxfObjectContextThe scale, a DxfAnnotationScale made in code and in no file.
Exceptions
- ArgumentNullException
Thrown when the scale is null.
- ArgumentException
Thrown when the context is not a DxfAnnotationScale, is in a file already, has no name, or has the name of a scale of the list, as AutoCAD answers eDuplicateKey.
- InvalidOperationException
Thrown when the drawing has no OBJECTS section, or has no ACAD_SCALELIST and is older than R2007, or holds an ACAD_SCALELIST that is not a dictionary.