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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Download secondary content using JLink

JurajKosmel
5-Regular Member

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


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

View solution in original post

6 REPLIES 6

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

JurajKosmel
5-Regular Member
(To:YaroslavSin)

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.

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.

JurajKosmel
5-Regular Member
(To:YaroslavSin)

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?


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

JurajKosmel
5-Regular Member
(To:YaroslavSin)

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

Top Tags