Hi All,
I am a new developer in PW area. Recently I encountered a problem as my title said. I have a flat set which I know its projectid and docmentid, I tried to use aaApi_GetSetIdsByMasterDoc but not success. Who can give me an example for this function? Or another function to do this?
Thanks, Xue
I assume that the set is a document. Use aaApi_SelectDocument or aaApi_SelectDocumentDataBuffer to get the document information. then use either aaApi_GetDocumentNumericProperty for the former and aaApi_DmsDataBufferGetNumericProperty for the latter. Use DOC_PROP_SETID as the property to fetch.
Answer Verified By: xue.yulian
Thanks Dean,
It is a so direct and simple method but I don't find it. I originally think set document itself is not a child doc in set, so I don't try this approach.
Thank you again. Xue
I know it is an old topic, but in case it might be useful, here is a code snippet to retrieve the first set id of a logical set (if it exists) using aaApi_GetSetIdsByMasterDoc :
long getLSetIdFromMasterDoc(long lProjectId, long lDocumentId) { long nbDocs; LPAASETIDINFO pIdInfo; unsigned long type = 0; if (aaApi_GetSetIdsByMasterDoc(lProjectId, lDocumentId, AADMS_MASTER_LOGICAL, nullptr, -1, &nbDocs, &pIdInfo, &type) ) { if (nbDocs > 0) return pIdInfo->lSetId; } return -1; }
For some reason, the aaApi_SelectDocument / aaApi_GetDocumentNumericProperty(DOC_PROP_SETID ) was not working for me...