Message 1 of 8
Using wblockCloneObjects + dimensions
Not applicable
04-02-2004
06:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to use AcDbDatabase::wblockCloneObjects to copy some entities
from one drawing to another. This seems to work fine as long as the
entities being copied are not dimensions. The dimensions get copied, but
for whatever reason they aren't ever displayed. I can get around this
problem by using AcDbDatbase::insert(), but i'm dealing with a specific set
of entities. I could get around THAT problem by simply using wblock, and
THEN insert - but with large drawings i'm noticing that having to do two
steps like that is slowing things down. So is there something special you
have to do with dimensions to get them to show up, or do i need to use those
other functions?
Here's basically what i'm doing. In the actual code i'm using, i check
error status on every single statement - nothing returns any errors, and
everything but dimensions are displayed fine after the copy. It all looks
just as it does in the original file.
// The databases to use are sent in.
// pSourceDb is an external DWG file that was opened using readDwgFile.
// pDestDb is (in this case) the current document.
// Get the model space id for source and destination databases
AcDbObjectId idSrc, idDest;
idSrc = GetModelSpaceId(pSourceDb);
idDest = GetModelSpaceId(pDestDb);
// Build a list of entities that need to be copied
AcDbObjectIdArray idsToCopy;
// Get entities here. Use idSrc to open block record
// and choose the ents we need. (left out for brevity)
AcDbIdMapping idMap;
idMap.setDestDb(pDestDb);
pSource->wblockCloneObjects(idsToCopy, idDest, idMap, AcDb::kDrcIgnore);
Are there more steps i need to add for dimensions?