Message 1 of 2
get_ReferencingDocuments API is not working as expected for Multiple Model State
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
I have been working on Inventor 2023 and trying to access the Referencing Document of a Part using get_ReferencingDocuments API.
I have created below Structure in CAD
Drawing1.idw Drawing2.idw
|_Part1.ipt |_Part1.ipt
Now all the above documents are opened in Inventor and keep Part1.ipt active in CAD Session.
I have written below code which is working fine in case of Single Model State but not working for multiple model state.
a) In case of Single Model State get_ReferencingDocuments is returning list of opened drawing file.
b) But in case of Multiple Model State get_ReferencingDocuments is returning list of part files instead of drawing file.
Could you please suggest me how to access ReferencingDocuments of Part in case of Multiple Model State in Part or It is a bug from Inventor side.
Code Smaple :-
DocumentsEnumeratorPtr ReferencingDocs;
if (SUCCEEDED(hr) && !!pDocument)
hr = pDocument->get_ReferencingDocuments(&ReferencingDocs); //Getting incorrect list in case multiple Model State in Part
long lReferencingDocsCount;
if (SUCCEEDED(hr) && !!ReferencingDocs)
hr = ReferencingDocs->get_Count(&lReferencingDocsCount);
if (SUCCEEDED(hr) && ReferencingDocs)
{
for (int i = 1; i <= lReferencingDocsCount; i++)
{
DocumentPtr DocPtr = ReferencingDocs->GetItem(i);
BSTR bstrFullFileName;
if (SUCCEEDED(hr) && DocPtr)
hr = DocPtr->get_FullFileName(&bstrFullFileName);
}
}
Thanks