Hi,
You can try this:
1. Catch the AcEditorReactor::beginWblock event, temporarily change the
unnamed block from UCS to WCS and record the transformation matrix.
2. Catch the AcEditorReactor::endWblock event, change the unnamed block back
to UCS using the inversed matrix of the recorded one.
This process can ensure that the block in source database keeps unchanged
while the copied block in destination database is in WCS.
Thanks
-Jerry
"Markus Griesser" дÈëÏûÏ¢ÐÂÎÅ:5075245@discussion.autodesk.com...
Hi all!
The following code-snippet "copies" an unnamed block with all
of its entities. It works fine when working with wcs coordinates,
but if the user switches to an object-related ucs or similar, the
entities of the copied block are rotated/moved when using wblock.
Is there any possibility to "ignore" the ucs while wblock?
Thanks in advance
Markus
// ---- Code
AcDbObjectIdArray IdArray;
for(BlockIter->start(); !BlockIter->done(); BlockIter->step()){
AcDbObjectId EntId;
if(BlockIter->getEntityId(EntId) == Acad::eOk)
IdArray.append(EntId);
}
pRec->close();
pTable->close();
delete BlockIter;
if(IdArray.isEmpty()){
return(false);
}
AcDbDatabase *pTemp = NULL;
Acad::ErrorStatus es = pDwg->wblock(pTemp, IdArray,
AcGePoint3d::kOrigin);
if(es != Acad::eOk){
return(false);
}