acad-database-operations
Installation
SKILL.md
AutoCAD Database Operations
Use this skill when copying objects between databases, processing external .dwg files, importing blocks, purging unused records, or working with side databases outside the active document.
WblockCloneObjects -- Copying Between Databases
WblockCloneObjects copies objects from one database to another. This is the primary mechanism for importing entities, symbol table records, or any named objects across drawings.
public static void CopyEntitiesBetweenDatabases(
Database sourceDb, Database destDb, ObjectIdCollection sourceIds)
{
using (Transaction tr = sourceDb.TransactionManager.StartTransaction())
{
ObjectId destModelSpaceId = SymbolUtilityServices.GetBlockModelSpaceId(destDb);
IdMapping idMap = new IdMapping();