cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

How to download all visualizations

srohde
1-Newbie

How to download all visualizations

Hi Community,

in one of our current projects we need to download all visualizations available in Windchill. As we noticed visualizations in windchill are not connected to the filevault via database tables.

How can we get to all the visualizations available in windchill? They may be available in the file vaults, since there are a lot of files in file vaults, not available in epm document file tables, but where can i get the real file names?

Regards

Stefan

1 ACCEPTED SOLUTION

Accepted Solutions
satre-2
1-Newbie
(To:srohde)

Below is sample SQL will give you the links between tables and actual file location in local drive

select ap.fileName,fvm.path ,ad.filesize ,

fvm.path || '\' || to_char(fvi.uniquesequencenumber,'0000000000000x') as VaultName

from

ApplicationData ap,HolderToContent hc,DerivedImage de,FvItem fvi ,FvFolder fvf , FvMount fvm 

where

hc.idA3B5=ap.idA2A2 and de.idA2A2=hc.idA3A5

and ap.idA3A5=fvi.idA2A2 and fvi.idA3A4=fvf.idA2A2 

AND  fvm.idA3A5=fvf.idA2A2;

Hope it helps !!

Thanks

Shreyas

View solution in original post

7 REPLIES 7
ChrisSpartz
12-Amethyst
(To:srohde)

You could write a DB query to get the filevault location of all the visualizations. The DB table that stores information about visualizations is the DerivedImage table.

Hey Chris,

thank you for your answer. Do you know how the DerivedImage table is conncted to the fvitem table? Or how do i find out the where the derived image is stored in the file system?

Regards.

satre-2
1-Newbie
(To:srohde)

You can write custom java class file to download representation to Local disk

Below are the few API’s which may help you to write custom java class / utility.


To Get representation for EPMDocument/Drawing

VisualizationHelper helper = new VisualizationHelper();

QueryResult qr = helper.getRepresentations(epmm);

   

Write custom method to file correct and default representation


Representation representation = getLatestRepresentation(qr);



Use below code to download representation/PDF to folder Local Drive.


  ContentHolder holder = ContentHelper.service.getContents(representation);

  Vector contents = ContentHelper.getContentListAll(holder);

  ApplicationData data = null;

  for (int i = 0; i < contents.size(); i++) {

  if (contents.get(i) instanceof ApplicationData) {

  data = (ApplicationData) contents.get(i);


  if (data != null && data.getFileName().endsWith(".pdf")) {

  iDownloadDocuments++;

  String dLFile = data.getFileName();

  int index = dLFile.lastIndexOf("_");

  String dLFile_trim = dLFile.substring(0,index);

  //String out_path_dir = dlLoc + "\\" +dLFile;

  String path = dlLoc + "\\" + dLFile_trim+"_"

  + epmm.getVersionIdentifier().getValue()

  + "."

  + epmm.getIterationIdentifier().getValue()

  + ".pdf";

  ContentServerHelper.service.writeContentStream(

  data, path.toUpperCase());

  writelog(epmm.getCADName() + " : PDF downloaded");

  System.out.println("Download Executed.\n");

  System.out.println("File name is"+data.getFileName());

  break;

  }

  }

  }

Hope this helps !!!

Thanks

Shreyas

srohde
1-Newbie
(To:satre-2)

I never wrote a java class for windchill. Haven't set up any IDE to write custom code for windchill. Would prefer a database solution if possible.

satre-2
1-Newbie
(To:srohde)

Below is sample SQL will give you the links between tables and actual file location in local drive

select ap.fileName,fvm.path ,ad.filesize ,

fvm.path || '\' || to_char(fvi.uniquesequencenumber,'0000000000000x') as VaultName

from

ApplicationData ap,HolderToContent hc,DerivedImage de,FvItem fvi ,FvFolder fvf , FvMount fvm 

where

hc.idA3B5=ap.idA2A2 and de.idA2A2=hc.idA3A5

and ap.idA3A5=fvi.idA2A2 and fvi.idA3A4=fvf.idA2A2 

AND  fvm.idA3A5=fvf.idA2A2;

Hope it helps !!

Thanks

Shreyas

Also above SQL will only work if you have configured vaulting rule to store derived images in File vault not in blob.

if derived images are stored in blob then you have to write custom java class to extract all PDF's in bulk

srohde
1-Newbie
(To:srohde)

This was what i searched for , works like a charm. Thank you very much sir . Your help was greatly appreciated.

Top Tags