[CONNECT C++] Copy context resizes the elements x10

Hello,

I'm trying to use the ElementCopyContext class in order to copy each element from an attached DWG file. Later I'd like to import only some of the elements.

The problem is the final result, it is ten time bigger than the attached file. I tried to use SetTransformToDestination(true) in order to fix this, but it's not better.

Any idea? Thanks by advance!

for (PersistentElementRefP const& elemRef : modelP->GetElementsCollection())
{
  DgnPlatform::EditElementHandle* elmhandle = new DgnPlatform::EditElementHandle(elemRef->GetElementId(), modelP);
  DgnPlatform::ElementCopyContext copyContext(ACTIVEMODEL);
  copyContext.SetSourceModelRef(elmhandle->GetModelRef());
  copyContext.SetTransformToDestination(true);
  copyContext.SetWriteElements(true);
  copyContext.DoCopy(*elmhandle);
}

Parents Reply Children
No Data