本文整理汇总了C++中AcDbDatabase::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbDatabase::insert方法的具体用法?C++ AcDbDatabase::insert怎么用?C++ AcDbDatabase::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcDbDatabase
的用法示例。
在下文中一共展示了AcDbDatabase::insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dbox
void
ArxDbgUiTdcWblockClone::doInsertOption(AcDbDatabase* tmpDb)
{
AcDbDatabase* destDb = getDestDb();
if (destDb == NULL) {
ArxDbgUiTdmDatabase dbox(tmpDb, this, _T("Wblock'd Database"));
dbox.DoModal();
doSaveOption(tmpDb);
}
else {
Acad::ErrorStatus es;
// lock the document we are inserting into
ArxDbgDocLockWrite docLock(destDb);
if (docLock.lockAndSetCurrent() != Acad::eOk)
return;
es = destDb->insert(AcGeMatrix3d::kIdentity, tmpDb, false);
if (es == Acad::eOk) {
ArxDbgUiTdmDatabase dbox(destDb, this, _T("Wblock/Insert Database"));
dbox.DoModal();
doSaveOption(destDb);
}
else {
CString str;
str.Format(_T("Insert failed: %s"), ArxDbgUtils::rxErrorStr(es));
ArxDbgUtils::stopAlertBox(str);
}
}
}
示例2: docLock
void
ArxDbgUiTdcInsert::OnInsertBlkDef()
{
CString blkName;
m_ebDestName1.GetWindowText(blkName);
if (!acdbSNValid(blkName, false)) {
CString str;
str.Format(_T("%s is not a valid block name."), blkName);
ArxDbgUtils::alertBox(str);
return;
}
UpdateData(TRUE);
bool isExternal;
AcDbDatabase* sourceDb = getSourceDb(isExternal);
AcDbDatabase* destDb = getDestDb();
ASSERT(sourceDb != destDb);
Acad::ErrorStatus es;
// lock the document we are inserting into
ArxDbgDocLockWrite docLock(destDb);
if (docLock.lockAndSetCurrent() != Acad::eOk)
return;
bool preserveSrcDb = intToBool(m_preserveOriginalDb);
if (!preserveSrcDb && !isExternal) {
ArxDbgUtils::alertBox(_T("Ignoring setting of \"Preserve source database\" since destroying\na database associated with a Document would be harsh."));
preserveSrcDb = true;
}
AcDbObjectId blkId;
es = destDb->insert(blkId, blkName, sourceDb, preserveSrcDb);
if (es == Acad::eOk) {
ArxDbgUiTdmDatabase dbox(destDb, this, _T("Inserted Database"));
dbox.DoModal();
doSaveOption(destDb);
if (isExternal && !preserveSrcDb)
reloadRaidedExternalDwg(sourceDb);
}
else {
CString str;
str.Format(_T("Insert failed: %s"), ArxDbgUtils::rxErrorStr(es));
ArxDbgUtils::stopAlertBox(str);
}
}