本文整理汇总了C++中AcDbObject::wblockClone方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbObject::wblockClone方法的具体用法?C++ AcDbObject::wblockClone怎么用?C++ AcDbObject::wblockClone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcDbObject
的用法示例。
在下文中一共展示了AcDbObject::wblockClone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
ArxDbgAppEditorReactor::beginDeepCloneXlation(
AcDbIdMapping& idMap, Acad::ErrorStatus* es)
{
m_didTheseDicts.setLogicalLength(0); // reset the dictionaries we have processed
AcDbDatabase* origDb;
AcDbDatabase* destDb;
idMap.origDb(origDb);
idMap.destDb(destDb);
AcDbObject* clonedObj;
AcDbObject* objToClone;
// we catch this event so that we can wblock objects that are not entities.
// This happens from the class ArxDbgUiTdcWblockClone where you are allowed
// to pick non-entities to wblock to a new/existing drawing. AcDbDatabase::wblock()
// only allows entities to be in the set of objects passed to it, but you
// can manually wblockClone them yourself here.
if (idMap.deepCloneContext() == AcDb::kDcWblock) {
// see what non-entity objects we have to clone by hand.
AcDbObjectIdArray handCloneObjects;
m_cloneSet.getObjectsForDatabase(origDb, handCloneObjects);
if (handCloneObjects.isEmpty())
return;
// walk through the clone set and try to clone
// everything. If something is already cloned,
// its ok, it won't be cloned again or return an
// error, it will just set clonedObj to NULL.
CString str;
int len = handCloneObjects.length();
for (int i=0; i<len; i++) {
clonedObj = NULL;
if (acdbOpenAcDbObject(objToClone, handCloneObjects[i], AcDb::kForRead) == Acad::eOk) {
objToClone->wblockClone(destDb, clonedObj, idMap, Adesk::kFalse);
if (clonedObj != NULL) {
acutPrintf(_T("\nArxDbgAppEditorReactor: cloned additional object [%s, %s]"),
ArxDbgUtils::objToClassStr(clonedObj),
ArxDbgUtils::objToHandleStr(objToClone, str));
clonedObj->close();
}
objToClone->close();
}
}
}
// catching this event allows us to correctly bring in our Dictionary Records.
// If we don't do this, then they will be orphaned. AutoCAD will not hook up
// the cloned dictionary records automatically.
else if ((ArxDbgOptions::m_instance.m_doDictRecordInsertByHand) &&
((idMap.deepCloneContext() == AcDb::kDcInsert) ||
(idMap.deepCloneContext() == AcDb::kDcInsertCopy))) {
// have to manually find all things we are interested in inserting.
// So, look for all ArxDbgDictRecords, if its a dict record,
// make sure owner dict is cloned in new database
AcDbObjectIdArray objIds;
collectAllDictRecords(origDb, objIds);
int len = objIds.length();
for (int i=0; i<len; i++) {
// find out if object is a dict record
Acad::ErrorStatus es;
es = acdbOpenObject(objToClone, objIds[i], AcDb::kForRead);
if (es == Acad::eOk) {
acutPrintf("\nArxDbgAppEditorReactor: hand inserting [%s]", ArxDbgUtils::objToClassStr(objToClone));
// clone the owner dictionary if one of our dictionary records
if (objToClone->isKindOf(ArxDbgDbDictRecord::desc()))
insertCloneOwnerDict(objToClone->ownerId(), destDb, idMap);
objToClone->close();
}
}
}
}