本文整理汇总了C++中AcDbObject::objectId方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbObject::objectId方法的具体用法?C++ AcDbObject::objectId怎么用?C++ AcDbObject::objectId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcDbObject
的用法示例。
在下文中一共展示了AcDbObject::objectId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
ArxDbgAppEditorReactor::searchOneDictionary(AcDbDictionary* dict, AcDbObjectIdArray& objIds)
{
// get an iterator over this dictionary
AcDbDictionaryIterator* dictIter = dict->newIterator();
ASSERT(dictIter != NULL);
// walk dictionary and just collect all the entries that are of the
// given type
AcDbObject* obj;
for (; !dictIter->done(); dictIter->next()) {
if (acdbOpenAcDbObject(obj, dictIter->objectId(), AcDb::kForRead) == Acad::eOk) {
if (obj->isKindOf(ArxDbgDbDictRecord::desc())) {
objIds.append(obj->objectId());
}
else if (obj->isKindOf(AcDbDictionary::desc())) {
searchOneDictionary(AcDbDictionary::cast(obj), objIds);
}
obj->close();
}
}
delete dictIter;
dict->close();
}
示例2: idPair
void
ArxDbgAppEditorReactor::insertCloneMergeDicts(AcDbDictionary* srcDict,
AcDbDictionary* destDict, AcDbIdMapping& idMap)
{
AcDbObjectId tmpObjId;
AcDbObject* objToClone;
AcDbObject* clonedObj;
AcDbDictionaryIterator* iter;
iter = srcDict->newIterator();
for (; !iter->done(); iter->next()) {
iter->getObject(objToClone, AcDb::kForRead);
// if an entry with this name is found already, don't clone
// it, add to the idMap to say that this one got translated
// to one that already exists
const char *pName = iter->name();
if (destDict->getAt(pName, tmpObjId) == Acad::eOk) {
AcDbIdPair idPair(objToClone->objectId(), tmpObjId, true, false, true);
idMap.assign(idPair);
objToClone->close();
}
else {
// doesn't exist yet in the destination dict, so clone and
// place it there.
clonedObj = NULL;
objToClone->deepClone(destDict, clonedObj, idMap);
// INSERT usually uses a method of cloning
// called CheapClone, where it "moves" objects
// into the destination database instead of
// actually cloning them. When this happens,
// objToClone and clonedObj are pointers to the
// same object. We only want to close pObj
// here if it really is a different object.
if (objToClone != clonedObj)
objToClone->close();
if (clonedObj) {
destDict->setAt(pName, clonedObj, tmpObjId);
clonedObj->close();
}
}
}
delete iter;
}
示例3: if
void
ArxDbgUtils::collectVertices(const AcDbPolyFaceMesh* pface, AcDbObjectIdArray& vfaces, AcGePoint3dArray& pts)
{
AcDbObjectIterator* vertexIter = pface->vertexIterator();
if (vertexIter == NULL)
return;
AcDbFaceRecord* vface;
AcDbPolyFaceMeshVertex* pfaceVertex;
AcDbObject* obj;
// walk through and seperate vfaces and vertices into two
// seperate arrays
Acad::ErrorStatus es;
for (; !vertexIter->done(); vertexIter->step()) {
es = acdbOpenObject(obj, vertexIter->objectId(), AcDb::kForRead);
if (es == Acad::eOk) {
if ((vface = AcDbFaceRecord::cast(obj)) != NULL)
vfaces.append(obj->objectId());
else if ((pfaceVertex = AcDbPolyFaceMeshVertex::cast(obj)) != NULL)
pts.append(pfaceVertex->position());
else {
ASSERT(0);
}
obj->close();
}
else
ArxDbgUtils::rxErrorMsg(es);
}
delete vertexIter;
}
示例4: acdbOpenAcDbObject
void
ArxDbgUiTdcWblockClone::divideCloneSet(const AcDbObjectIdArray& cloneSet,
AcDbObjectIdArray& nonEntSet,
AcDbObjectIdArray& okToCloneSet)
{
Acad::ErrorStatus es;
AcDbObject* obj;
int len = cloneSet.length();
for (int i=0; i<len; i++) {
es = acdbOpenAcDbObject(obj, cloneSet[i], AcDb::kForRead);
if (es == Acad::eOk) {
if (obj->isKindOf(AcDbEntity::desc()))
okToCloneSet.append(obj->objectId());
else
nonEntSet.append(obj->objectId());
obj->close();
}
}
}
示例5: acdbOpenAcDbObject
void
ArxDbgUiTdcPersistentReactors::attachObjReactors(const AcDbObjectIdArray& objIds)
{
Acad::ErrorStatus es;
AcDbObject* obj;
ArxDbgPersistentObjReactor* peReactor;
AcDbObjectId prId;
ArxDbgDocLockWrite docLock; // these potentially came from other documents
int len = objIds.length();
for (int i=0; i<len; i++) {
es = docLock.lock(objIds[i].database()); // lock the document associated with this database
if (es == Acad::eOk) {
es = acdbOpenAcDbObject(obj, objIds[i], AcDb::kForWrite, true);
if (es == Acad::eOk) {
prId = getPersistentObjReactor(objIds[i].database(), true);
if (ArxDbgUiTdmReactors::hasPersistentReactor(obj, prId)) {
ArxDbgUtils::alertBox(_T("That object already has the reactor attached."));
}
else {
obj->addPersistentReactor(prId);
es = acdbOpenObject(peReactor, prId, AcDb::kForWrite);
if (es == Acad::eOk) {
peReactor->attachTo(obj->objectId());
peReactor->close();
}
else {
CString str;
str.Format(_T("ERROR: Could not update backward reference in reactor: (%s)"), ArxDbgUtils::rxErrorStr(es));
ArxDbgUtils::stopAlertBox(str);
}
}
obj->close();
}
else {
ArxDbgUtils::rxErrorMsg(es);
}
}
else {
ArxDbgUtils::rxErrorAlert(es);
}
}
}