Vault Customization

Vault Customization

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

Downloading all Assembly parts to workspace with API.

527 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 (441 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 (415 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: 531
Registered: ‎06-07-2010
Message 4 of 5 (409 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: 60
Registered: ‎07-31-2007
Message 5 of 5 (301 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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.