Records the source-to-destination translation of objects and record names during a deep clone or wblock clone.

Mirrors AcDbIdMapping in ObjectARX. In addition to id pairs it keeps a per-kind name map, because entities in this data model reference layers, linetypes, styles and blocks by name.

const idMap = new AcDbIdMapping()
idMap.destDb = targetDb
sourceDb.wblockCloneObjects(ids, targetDb.tables.blockTable.modelSpace.objectId, idMap, AcDbDuplicateRecordCloning.Ignore)
for (const pair of idMap) console.log(pair.key, '->', pair.value)

Constructors

Properties

deepCloneContext: AcDbDeepCloneType

Context of the clone operation

destDb?: AcDbDatabase

Destination database of the clone operation

duplicateRecordCloning: AcDbDuplicateRecordCloning

How records with a name already used in the destination are handled

sourceDb?: AcDbDatabase

Source database of the clone operation

Accessors

Methods

  • Translates a source object id into the destination id.

    Parameters

    • key: undefined | null | string

      Object id in the source database.

    Returns undefined | string

    The destination id, or undefined when the id was not cloned.

  • Translates a record name from the source to the destination database.

    Names that were not remapped (including names that were not cloned at all) are returned unchanged.

    Type Parameters

    • T extends undefined | null | string

    Parameters

    Returns T

  • Translates an object id held by a clone.

    Returns the destination id when the object was cloned or mapped onto an existing destination object. Otherwise the id is kept when cloning within one database, and dropped when cloning into another database, where the source id could name an unrelated object.

    Parameters

    • key: undefined | null | string

      Object id in the source database.

    Returns undefined | string

    The id to store on the clone, or undefined to drop it.