Share

AcDbDatabase::deepCloneObjects

C++

ACDBCORE2D_PORT Acad::ErrorStatus deepCloneObjects(
    const AcDbObjectIdArray& objectIds, 
    const AcDbObjectId& owner, 
    AcDbIdMapping& idMap, 
    bool deferXlation = false
);

Description

Clones all objects in the objectId array and appends them to the container object specified by owner. The idMap is filled with AcDbIdPair objects that contain the objectId entities of the original and cloned object pairs. This array can be used for post-processing the objects involved in the deepClone operation.

When the objects to be cloned do not all have the same owner, then it is necessary to make up individual AcDbObjectIdArray entities, each one containing all the objects with the same owner. The deepCloneObject method is then called once for each array, with the deferXlation argument set to Adesk::kTrue for all but the last call. Refer to the ObjectARX Developer's Guide for more information on the use of this function.

When the new objects are assigned owners, layout objects trigger an assert that the owner is the destination database's layout dictionary and the layout is given a name in the dictionary that matches the name stored inside the layout. (The default behavior for dictionary-owned objects would be to give it an anonymous name like "*A1".)

Parameters

Parameters Description
objectIds Input array of objects to be deep cloned
owner Input Object ID of object to be the owner of the clones
idMap Returns array of AcDbIdPair objects to be used for translating object ID relationships
deferXlation Input Boolean indicating whether or not ID translation should be done

Links

AcDbDatabase Class

Was this information helpful?