acdbBindXrefs in an external database

acdbBindXrefs in an external database

Anonymous
Not applicable
580 Views
0 Replies
Message 1 of 1

acdbBindXrefs in an external database

Anonymous
Not applicable

Hi,

I am trying to bind all the xref in a database that is created by my application. The following function runs without any error, but the xref are not binded.

I have checked the function in the working database, it works perfectly.

I have also tried calling the function after and before saving the new database with the same result.

What is wrong in this function ?

 

void BindAllXrefs(AcDbDatabase* pDatabase)
{
    Acad::ErrorStatus es;
    AcDbDatabase* pCurDb = acdbHostApplicationServices()->workingDatabase();
    acdbHostApplicationServices()->setWorkingDatabase(pDatabase);

    AcDbXrefGraph graphXref;
    if ((es = acedGetCurDwgXrefGraph(graphXref)) == Acad::eOk)
    {
    AcDbObjectIdArray xrefBlkIds;
    for (int idx=1; idx < graphXref.numNodes(); idx++)
    {
        AcDbXrefGraphNode *nodeXref = graphXref.xrefNode(idx);
        if (nodeXref)
        {
        AcDbObjectId btrId = nodeXref->btrId();
        xrefBlkIds.append(btrId);
        }
    }
    es = acdbBindXrefs( pDatabase, xrefBlkIds, true, false, false);
    }
    acdbHostApplicationServices()->setWorkingDatabase(pCurDb);
}

 

Thanks,

Marc

 

0 Likes
581 Views
0 Replies
Replies (0)