Skip to main content
10-Marble
December 10, 2020
Solved

Download secondary content using JLink

  • December 10, 2020
  • 1 reply
  • 3981 views

There is a method CopyFileToWS where one can specify a model to which a file will be copied as attachement (secondary content). What is a correct way to execute opposite action - to download a secondary content from a model? I can't see any notice in documentation / examples. The method CopyFileFromWS takes a file path, but what is a correct path format to a secondary content file? Or is there another function to achieve this? Thanks in advance.

Best answer by YaroslavSin

@JurajKosmel wrote:

Or it means I need to write a custom application with the function call?


Yes, it is mean that you mast write DLL with your own custom function witch will call ProFileCopyFromWSDocument() function using C TOOLKIT and then you can call your custom function from J-Link.

1 reply

17-Peridot
December 16, 2020

Not 100% true method, but...

Take a look at "Aliased URL" chapter in the documentation.

Using that set of functions try to construct right path to secondary content file

like this wtws://my_server/my_workspace/intf_file.igs

 

Some version of Creo required version information additional to extension

test.xml|0.0

or

text.xml|V0.0 (for Creo 2)

where 0.0 - is a PTC_WM_VERSION

10-Marble
December 21, 2020

Thank you for your answer. The aliased URLs are not working for a secondary content files. I've tried it with several path formats, even with version, but no success - I've always got com.ptc.pfc.Implementation.pfcExceptions$XToolkitInvalidFile.

17-Peridot
December 21, 2020

From Pro/Toolkit

The function ProFileCopyFromWSDocument() copies a primary or secondary file from the workspace to the specified location on disk.

 

So, in Jlink it maybe not possible. I'm not found equivalent in Java.