The documentations says that
IEdmReference9 has the Property RefConfiguration
'Get the reference tree interface
"Dim ref AsIEdmReference9"
"ref = file.GetReferenceTree(folder.ID, file.CurrentVersion)"
Sorry if this is not enough info, is there a specific task you are trying to achive?
You also may need to consider, if the Part is used in the Drawing, is it hidden, supressed, is it in a View on a sheet, etc..
I have a different tool to look at the structure of the SolidWorks files
I am actually trying to find the drawing ("parent") of the part file.
The part file has many configurations, each is used by a different drawing.
So the "where used" of the part can have 5 results, but for a specific configuration only 1 result is relevant.
Unfortunately, this method: IEdmReference7::GetFirstParentPosition2 doesn't say anything about configurations.
Hope this was clear...
There is a bug with the API.
What you should be able to do is get the parent refs of the file and then loop through those using GetFirstChildPosition3 passing the config name you're looking for. The refCount for the non referenced configurations should be zero, or the file should not be listed at all. Everything is listed as it stands now.
A method providing an upstream reference with configurations would even be better.
That's a good idea....
However I found out that there are 2 bugs that make it very difficult to use IEdmReference9:
1. SPR 657938: "IEdmReference9::GetFirstChildPosition3 returns even references that are suppressed"
2. SPR 697047: "Cannot get file configuration referenced by Item. EdmItemRef.mbsConfiguration and IEdmReference9::RefConfiguration both return an empty string."
Here is how I worked-around the limitations:
1. I used "GetComputedBOM" method in order to find the correct references (according to configurations).
2. In order to get all the drawings for a specific reference, I used "GetFirstParentPosition" and "GetNextParent".
3. Then, In order to decide which is the correct drawing for the specific configuration, I used The DocumentManager and used
ISwDMView Interface:ReferencedConfiguration Property
I still haven't verified how it is working when Versions are considered (latest/as built...).
Hopefully it will be OK
It would be slower, but maybe as a temporary work around you could use the Document Manager?
That is indeed what I did -
I loop over all the drawings found by EPDM's "GetFirstParentPosition" and "GetNextParent", and for each I am using the DocumentManager's ISwDMView Interface:ReferencedConfiguration, until I find the correct drawing.
They almost fixed the SPR 697047, IEDMReference9::RefConfiguration now returns @ for the configuration name.