Vault Customization

Vault Customization

Reply
Valued Contributor
mnav
Posts: 58
Registered: ‎12-15-2009
Message 1 of 5 (484 Views)

Downloading all Assembly parts to workspace with API.

484 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
suryanto.kurniawan
Posts: 6
Registered: ‎09-23-2007
Message 2 of 5 (398 Views)

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
bjr001
Posts: 51
Registered: ‎11-09-2009
Message 3 of 5 (372 Views)

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
minkd
Posts: 478
Registered: ‎06-07-2010
Message 4 of 5 (366 Views)

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
mario.lung
Posts: 56
Registered: ‎07-31-2007
Message 5 of 5 (258 Views)

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

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.