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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Translate the entire conversation x

ProToolkit API Search and Download Windchill Document Object's Primary Content

IB_10798296
3-Newcomer

ProToolkit API Search and Download Windchill Document Object's Primary Content

Hello,

 

I'm working with Creo 10, and I need to do some modifications in a model and its external data programatically (through Protoolkit API) based on  some information contained into a XML file which is the primary content of a Windchill Document.

 

I'm wondering if there are methods defined in API which can help me to do that, I don't want to modify the file, only read it.

 

I tried to retrieve the document by using the "ProServerObjectsCheckout" function but it didn't find anything. I'm not sure this is possible since I don't see defined any appropriate handler (ProSolid, ProDrawing, etc.) for WT Documents.

 

Thanks.

Ivan B.

 

2 REPLIES 2
RPN
17-Peridot
17-Peridot
(To:IB_10798296)

Hi. Check ProUtil.h. Here you find a couple of functions to deal with secondary content and related documents. 

 

There is also a function to enter a URL’s , this may called to retrieve a persistent link. Maybe after calling this it may part of the workspace or the local cache. 

IB_10798296
3-Newcomer
(To:RPN)

Hey, thanks for your help, yeah, I already inspected the ProUtil.h library, and it seems those functions work with a path which is returned by some other functions that require manual intervention (like to select a file from a popup window), that function would be helpful if accepted the direct Windchill URL.

 

This function seems to be useful to copy the file from the workspace to a local directory, but we also need first to add that file from Windchill to a worskpace:

IB_10798296_0-1752248444037.png

 

This other function would help me to get either the primary or secondary content, but I also need first to know the file URL:

IB_10798296_1-1752248680137.png

 

The only function I found in order to get the URL programmatically is the "ProServerObjectsCheckout" but this is only useful for model but not for WTDocuments.

 

At this point, I think I have exhausted all the ProToolkit options available,

 

What I'm trying to do right now is to use the Windchill OData REST API through a small C# library (to get the URL and download the file to a local directory), which is called by a C++/CLI wrapper and then by the C++ toolkit app, unfortunately I'm having issues at the time I compile in release mode, which seems to be something related to the runtime configuration /MT (instead of /MTd (debug version) which works fine), but this is an issue for a different topic.

 

Thanks!

 

 

 

 

 

 

 

 

Announcements


Top Tags