Method HandOverTo
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
HandOverTo(DxfDBObject, bool, bool)
Puts an object made in code in this one's place in the drawing, as AutoCAD's HandOverTo hands an object's id
over: the new object's records written where this one's stand, in its block and at its place among the block's
entities, with this one's handle, owner and reactors, so that what pointed at this one points at the new one; this
one is in no file from then on, a copy of what it was with no handle and no owner, to be appended again or let go.
public void HandOverTo(DxfDBObject newPointer, bool keepXData, bool keepExtensionDictionary)
Parameters
newPointerDxfDBObjectThe object to take the place: an entity made in code, or copied, and in no file.
keepXDataboolWhether the new object takes this one's extended data, which then replaces its own where this one has some; false keeps the new object's own.
keepExtensionDictionaryboolWhether the new object takes this one's extension dictionary; false takes the dictionary out of the drawing, with what it holds.
Remarks
A LINE handed over to a new DxfCircle(centre, normal, 5) on the layer holes is that circle under the LINE's
handle: a GROUP that held the line holds the circle, and the circle is on holes in its own colour, as made. The new
object is written as AppendEntity(DxfEntity) writes one, its layer added to the table where
the table has none of it and what it brings from another drawing copied with it; a record that follows it, as a
VERTEX, is given a handle of its own and owned by the handle it takes. The records that followed this one, as the
vertices of a POLYLINE, go, their handles not given again.
A copy of an annotative entity that carries its original's contexts (Clone()) is given them as AppendEntity(DxfEntity) gives them, where this one's extension dictionary is not kept; kept, that dictionary stands for the copy's, its contexts those this one had, or none, as AutoCAD 2021 writes it: a LINE handed over to the copy of a TEXT shown at (11, 12) at 1:1 beside its default of 1:2 at (40, 12) is that TEXT shown at (11, 12) at both, its dictionary not kept, and at (40, 12) at none, kept (check D35d). Kept, the extended data of this one replaces the new object's where this one has some; where it has none, the new object keeps its own, its AcadAnnotative among it, as AutoCAD 2021 keeps it.
Kept, the dictionary's contexts are not converted, as AutoCAD 2021 converts none, and those of another kind of entity are refused: AutoCAD crashed reading its own drawings of a TEXT handed over to an MTEXT, an MTEXT to a TEXT, an INSERT to a TEXT and a TEXT to an INSERT, each keeping its dictionary (check D35e). A TEXT, an ATTDEF and an ATTRIB take one another's contexts, which AutoCAD read; an MTEXT and an INSERT their own; an entity never annotative, as a LINE, any; a dimension, a leader, a multileader, a tolerance and a hatch those of their own class alone.
Entities alone hand their place over: a record of a table, a dictionary and the other objects of the OBJECTS section are refused, as is a VERTEX or an ATTRIB, which belongs to the entity it follows.
Exceptions
- ArgumentNullException
Thrown when the new object is null.
- ArgumentException
Thrown when the new object is this one, is in a file already or erased, or is one this drawing's version cannot hold, as AppendEntity(DxfEntity) refuses it; or when the extension dictionary is kept and holds contexts of a kind the new object does not take, as a TEXT's handed over to an MTEXT; nothing is written then.
- InvalidOperationException
Thrown when this object is in no file, or is erased.
- NotSupportedException
Thrown when either object is not an entity, or this one follows another.