Vault Customization

Vault Customization

Reply
Valued Contributor
58 Posts
0 Kudos
Registered: ‎12-15-2009
Post 1 of 5

Downloading all Assembly parts to workspace with API.

546 Views, 4 Replies
02-25-2013 12:09 PM

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.

Employee
6 Posts
0 Kudos
Registered: ‎09-23-2007
Post 2 of 5

Re: Downloading all Assembly parts to workspace with API.

03-11-2013 05:07 AM 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

 

Valued Contributor
51 Posts
0 Kudos
Registered: ‎11-09-2009
Post 3 of 5

Re: Downloading all Assembly parts to workspace with API.

03-13-2013 12:24 AM 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.

 

 

 

Employee
541 Posts
48 Kudos
Registered: ‎06-07-2010
Post 4 of 5

Re: Downloading all Assembly parts to workspace with API.

03-13-2013 10:04 AM 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
Data Management
Autodesk, Inc.
Valued Contributor
63 Posts
4 Kudos
Registered: ‎07-31-2007
Post 5 of 5

Re: Downloading all Assembly parts to workspace with API.

06-17-2013 06:59 AM in reply to: minkd

Hey,

 

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

with the method "GetFileAssociationLitesByIds"

 

thx

 

Mario

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!