ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

something about "endDeepClone(AcDbIdMapping & pIdMap)"

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
421232206
743 Views, 2 Replies

something about "endDeepClone(AcDbIdMapping & pIdMap)"

it is not easy to express my words, just see the codes below:

 

void CTDEditorReactor::endDeepClone(AcDbIdMapping & pIdMap)
{
    AcDb::DeepCloneType type = pIdMap.deepCloneContext();
    if (AcDb::kDcCopy == type || AcDb::kDcWblock == type || AcDb::kDcObjects == type)
    {// in Acad, you drag a line(not move,just use your mouse to drag an entity such as line), this action will invoke the "endDeepClone" (i don't quite understand) with type "AcDb::kDcWblock". 

   //and in the second case ,"AcDbDatabase* pCurDwg = acdbHostApplicationServices()->workingDatabase();
        pCurDwg->wblock(pDwg,idArr,AcGePoint3d::kOrigin);" can also invoke such action with type equal to "AcDb::kDcWblock == type"
        AcDbDatabase *pOutDb = NULL;
        pIdMap.destDb(pOutDb);
        AcDbDatabase* pCurDb = acdbCurDwg();
        const TCHAR* szCurFileName = NULL;
        const TCHAR* szOutFileName = NULL;
        pCurDb->getFilename(szCurFileName);pOutDb->getFilename(szOutFileName);

 

      // here ,I want the first case to return.  but not found a good way. I tested the AcdbDatabase::Filename,

    // I want to know if there is a good way to different the two cases.
        if ((NULL == szOutFileName || _tcsicmp(szCurFileName,szOutFileName) == 0) && AcDb::kDcWblock == type)
        {//在CAD中,用鼠标拖动实体,都会触发这个消息。
            AcEditorReactor::endDeepClone(pIdMap) ;
            return;
        }
........

Technology change world! Coding change technology! We coders are coding!
2 REPLIES 2
Message 2 of 3
owenwengerd
in reply to: 421232206

In addition to the cases you mention, there are many other cases where the cloning type is kDcWblock. I don't think you can or should distinguish. Instead, determine what the reason is for your reactor, and use the same criteria that define your reason.

--
Owen Wengerd
ManuSoft
Message 3 of 3
421232206
in reply to: owenwengerd

thanks, if there are many cases that will invoke "kDcWblock", I have to define some global variable to define the case I need.

Technology change world! Coding change technology! We coders are coding!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost