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;
}
........
Solved! Go to Solution.
Solved by owenwengerd. Go to Solution.
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.
thanks, if there are many cases that will invoke "kDcWblock", I have to define some global variable to define the case I need.