Skip to main content
1-Visitor
June 3, 2015
Solved

How to download all visualizations

  • June 3, 2015
  • 7 replies
  • 4077 views

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

Best answer by satre-2

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

7 replies

13-Aquamarine
June 4, 2015

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.

srohde1-VisitorAuthor
1-Visitor
June 9, 2015

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.

1-Visitor
June 9, 2015

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

srohde1-VisitorAuthor
1-Visitor
June 9, 2015

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