Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Downloading all Assembly parts to workspace with API.

4 REPLIES 4
Reply
Message 1 of 5
mnav
1687 Views, 4 Replies

Downloading all Assembly parts to workspace with API.

How i can download an assembly .iam file and all its parts to my workspace without changing any version or revision with vault 2013 API.

 

thanks.

4 REPLIES 4
Message 2 of 5
suryanto.kurniawan
in reply to: mnav

 

You can  use Inventor API to get all part files in an assembly.

 

Once you get the full file name for assembly and part files,  use web service Vault API (DownloadFile  or DownloadFilePart) to download files from Vault.

 

If you install vault SDK from C:\Program Files\Autodesk\ADMS Professional 2013\SDK folder, you can see sample  program how to download files from vault (VaultMirror.sln).

 

Regards,

Suryanto

 

Message 3 of 5
bjr001
in reply to: mnav

You want to get an assembly and all of his child relationships with Vault API ?

With this snippet you get all dependent files:

 

FileAssoc[] fileAssocs = _wsm.DocumentService.GetLatestFileAssociationsByMasterIds(
                    new long[] { _parentFile.MasterId },        // masterId of parent (your top assembly file)
                    FileAssociationTypeEnum.None,               // no parent associations
                    false,                                      // no parent recurse
                    FileAssociationTypeEnum.Dependency,         // dependent child assosciations
                    true,                                       // child recurse
                    false,                                      // don't include related documents (drawings)
                    false,                                      // don't include hidden files
                    true).First().FileAssocs;                   // latest version in released state

 

 Inside of fileAssocs you can get the child files (File object) from field CldFile.

But all the information are also available inside of Vault API Reference Help file.

 

 

 

Message 4 of 5
minkd
in reply to: bjr001

I highly recommend using the "GetFileAssociationLitesByIds" method instead of "GetLatestFileAssociationsByMasterIds".  The latter has serious performance issues when working with iParts or iAssemblies and will likely be deprecated in a future release.

 

Ideally, you would use the VDF to download the files (which uses the former method above).

 

-Dave



Dave Mink
Fusion Lifecycle
Autodesk, Inc.
Message 5 of 5
mario.lung
in reply to: minkd

Hey,

 

may i have a example code for checkout a assembly with all parts

with the method "GetFileAssociationLitesByIds"

 

thx

 

Mario

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report