Get “Reference by” list of documents using projectwise sdk or powershell

Hi All,

I was able to get the references from the document using

aaApi_GetReferenceList and aaApi_SelectNestedReferencesList

but , I am trying to get the "reference by" document

Like if document A has reference to document B, I want to know about document A when I have document B.

If anyone had tried it using SDK or may be powershell and would like to share?

Thank you.



  • Here is some SDK some code that I've used. Assumes you already have values for the folder (m_lVaultID) and document (m_lDocID). The generated data populates a document list (created elsewhere, m_hReferencedByList).

    // Referenced by List
    LONG lRefdCount = aaApi_SelectSetMasters(m_lVaultID, m_lDocID);
    for(int x = 0; x < (int)lRefdCount; x++)
        LONG lChildProjID = aaApi_GetSetNumericProperty(SET_PROP_PARENT_PROJECTID, (LONG)x); 
        LONG lChildDocID = aaApi_GetSetNumericProperty(SET_PROP_PARENT_ITEMID, (LONG)x);
        aaApi_SelectDocument(lChildProjID, lChildDocID);
        LONG lTables[1] = { 0L } ;
        LONG lCols[1] = { 0L } ;
        LONG lColVals[1] = { 0L } ;
        LONG lLinkCount = aaApi_SelectLinks(lChildProjID,lChildDocID);
        LONG lAttrID = 0L;
        if (lLinkCount > 0)
            lAttrID = _wtol(aaApi_GetLinkStringProperty(LINK_PROP_COLUMN_VALUE, 0L));
            for(int i = 0; i < (int)lLinkCount; i++)
                lTables[i] = aaApi_GetLinkNumericProperty(LINK_PROP_TABLEID, (LONG)i); 
                lColVals[i] = _wtol(aaApi_GetLinkStringProperty(LINK_PROP_COLUMN_VALUE, (LONG)i));
        aaApi_DocListAddItem3(m_hReferencedByList, x, 0, 0, lAttrID, FALSE, (INT)lLinkCount, lTables, lColVals, 0, AAAPI_SCROLL_ENSURE_VISIBLE);

    Please note that I post here on a voluntary basis and am not a Bentley employee. 

Reply Children
No Data