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

Download secondary content using JLink

SOLVED
JK_9748688
Participant

Download secondary content using JLink

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.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Download secondary content using JLink


@JK_9748688 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.

View solution in original post

6 REPLIES 6

Re: Download secondary content using JLink

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

Tags (1)

Re: Download secondary content using JLink

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.

Re: Download secondary content using JLink

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.

Re: Download secondary content using JLink

Yes, it seems not possible achieve this using direct JLink functions. Hovewer there is a function LoadProToolkitDll in chapter 'Launching a PTC Creo Parametric TOOLKIT DLL' of jlink manual. It looks like option to call Pro/Toolkit dlls from jlink. I'm not very familiar with Pro/Toolkit - is there a .dll with ProFileCopyFromWSDocument() function located somewhere in creo installation folders? Or it means I need to write a custom application with the function call?

Re: Download secondary content using JLink


@JK_9748688 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.

View solution in original post

Re: Download secondary content using JLink

Thank you! It's not tested solution as I have no C toolkit installed, but sounds like a right way.

Announcements