Method AddContext
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
AddContext(DxfObjectContext)
Makes the object shown at another scale, as AutoCAD's ObjectContexts.AddContext (the command OBJECTSCALE, Add): a
context of the scale is written next to the others under ACDB_ANNOTATIONSCALES of its extension dictionary, named
*A and one more than the highest number the object holds, not the default (290 of 0), and made from the default
context as AutoCAD 2021 makes it (checked on a TEXT, an MTEXT, an ATTDEF, a HATCH and an INSERT of an annotative block
drawn at 1:1 and 1:50): a TEXT and an attribute definition keep their point, angle and mode; an MTEXT keeps its place
and direction and has its width, the height of its box and the width and height of its words (40, 41, 42, 43)
multiplied by the default's scale over the new one's (an MTEXT 40 wide at 1:1 is 2000 wide at 1:50); a HATCH has the
lines of its pattern (43, 44, 45, 46, 49) multiplied so, and 1 over the scale in its group 40 (50 at 1:50), and has its
view context written first from its default context as it stands, replaced where it has one (KeepHatchView:
a hatch moved by (100, 50) and then given 1:2 holds 43 of 100, 44 of 50 in its view, as -OBJECTSCALE Add writes it); an INSERT
has its three factors multiplied so (50 at 1:50 for a 1 at 1:1) and each attribute of it that holds contexts is
given one as well, its point moved out from the INSERT's by the same factor: the attribute at (300, 1003) of an
INSERT at (300, 1000) is at (300, 1150) at 1:50. An INSERT that holds no context gets the scale as its one context,
the default, its record's factors and those of the context multiplied by 1 over the scale, as AutoCAD 2021 gave
it. A MULTILEADER holding text is laid out again: its scale (40) is 1 over the new scale's, its sizes (the
text height, the arrowhead, the landing gap, the dogleg) multiplied by the default's scale over the new one's, the landing
and its lines kept, and the content moved out from the landing by the new dogleg: text 0.2 high at 1:50 is 0.4 at 1:100,
a dogleg of 0.36 is 0.72, and the words stand 9.72 right of the landing (check GHAN4). The record of the other kinds is
kept: their size at the other scale is worked out from it.
public void AddContext(DxfObjectContext context)
Parameters
contextDxfObjectContextThe scale, of the object's drawing's list.
Exceptions
- ArgumentNullException
Thrown when the scale is null.
- ArgumentException
Thrown when the scale is not one of this drawing's list.
- InvalidOperationException
Thrown when the object is not annotative (Annotative), as AutoCAD answers eNotApplicable; is in no file, is erased, or is a copy in no file that carries its original's contexts.
- NotSupportedException
Thrown for a dimension, whose picture the library does not lay out (the presenter does: a context per scale each with its own block), for a multileader that holds neither words nor a block, and for the other annotative kinds whose contexts the library does not make for a second scale yet.