Vault API Where Used

Vault API Where Used

Alvee_sbt
Participant Participant
1,429 Views
6 Replies
Message 1 of 7

Vault API Where Used

Alvee_sbt
Participant
Participant

Vault 2024 API- "Where Used" files

 

Problem: I am trying to get the list of files in the "Where Used" tab. 

Scenario: C# .NET 4.8 win form application, I am using functions like- GetAssociatedFilePathsByIds

Example-

// I have tried using different sets of values for this below function's parameters.

long[] fileID = new long[] { file.Id };

Connection.WebServiceManager.DocumentService.GetAssociatedFilePathsByIds(fileID,
FileAssociationTypeEnum.Dependency, true, FileAssociationTypeEnum.Dependency, true, false, false);

 

Real: In the Vault pro-

I choose 999-0024.ipt, I see these in the "Where Used" tab-

> 999-0024.ipt

   >999-0023.iam (this is not showing at all in the function result)

   >999-0047.iam

   >999-0017.iam

   >999-0024.dwg

(I am looking for this exact list above)

 

After executing the function above, I get these results- (it comes with many files along with their version number)

>999-0024.ipt (ver 3)

   >999-0017.iam (ver 4)

   >999-0047.iam (ver 4)

   >999-0017.iam (ver 5)

   >999-0024.dwg (ver 1)

   >999-0017.dwg (ver 4)

   >999-0047.dwg (ver 6)

   >999-0017.dwg (ver 5)

 

Could I request any solid solution with codes that gives the same result or most accurate result? 

 

FYI- I have tried these, but did not get the exact results

API Where Used - Autodesk Community - Vault

Get Where Used Information for a Vault Item - Manufacturing DevBlog (typepad.com)

 

0 Likes
Accepted solutions (2)
1,430 Views
6 Replies
Replies (6)
Message 2 of 7

CGBenner
Community Manager
Community Manager

@Alvee_sbt 

Welcome to the forum.  I moved your post here for the customization experts to have a look at.

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!



Chris Benner

Community Manager - NAMER / D&M

Message 3 of 7

CGBenner
Community Manager
Community Manager

@Markus.Koechl Is this something that you might be able to help with?

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!



Chris Benner

Community Manager - NAMER / D&M

0 Likes
Message 4 of 7

Markus.Koechl
Autodesk
Autodesk

Hi @Alvee_sbt: you should get the parent listing using the DocumentService.GetLatestFileAssociationsByMasterIds(): 

WebServiceManager.DocumentService.GetLatestFileAssociationsByMasterIds(new long[] { _file.MasterId }, FileAssociationTypeEnum.None, false, FileAssociationTypeEnum.Dependency, false, false, false,false);


Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 5 of 7

Alvee_sbt
Participant
Participant

Thanks for your input, sir.


I tried the above approach, but no luck. here is the exact code-

FileAssocArray[] fileAssocArray = WebServiceManager.DocumentService.GetLatestFileAssociationsByMasterIds(new long[] { PartFile.MasterId }, FileAssociationTypeEnum.None, false, FileAssociationTypeEnum.Dependency, false, false, false, false);

 

Result is one item with null value, please see the picture below-

image.png

 

In the Vault pro, I can see there are- 3 assemblies and 1 drawing file (the searching part's own drawing file) listed.

 

- Alvee

0 Likes
Message 6 of 7

Markus.Koechl
Autodesk
Autodesk
Accepted solution
This was my fault; I hope you apologize. I reviewed the documentation and recognized that the first association type targets the parents and the other the children. So the correct call is: GetLatestFileAssociationsByMasterIds(new long[] { _file.MasterId }, FileAssociationTypeEnum.Dependency, false, FileAssociationTypeEnum.None, false, false, false, false);


Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 7 of 7

Alvee_sbt
Participant
Participant
Accepted solution

Thanks so much, @Markus.Koechl sir. Your last function call is the correct answer. For others, as a reference-

//using ACW = Autodesk.Connectivity.WebServices;

ACW.FileAssocArray[] fileAssocArray = Program.Connection.WebServiceManager.DocumentService.GetLatestFileAssociationsByMasterIds(new long[] { fileMasterId }, ACW.FileAssociationTypeEnum.Dependency, false, ACW.FileAssociationTypeEnum.None, false, false, false, false);

 

 

0 Likes