Version: Windchill 11.1
Use Case: I have two Windchills that belong to different organizations, but are the copy of each other. I want to create a utility that takes a list of WT_Documents numbers as initial data, downloads the default representations from one Windchill to a local drive, and then creates these representations for the same documents in another Windchill.
Description:
Some of the downloaded representations may be created manually, so I cannot use the agents and create the representations using visualization server. If anuone knows about API that can help with my problem, I will be very appreciated for sharing.
Hi @AP_11091323
Thank you for your question!
Please provide screenshot(s) to better understand what you are trying to do in your process.
Please refer to this guideline to make your questions more likely to receive a quick and useful answer.
This will increase your chances to receive meaningful help from other Community members.
Thank you for your participation and please let me know if you need further assistance!
Best regards,
Are they clones and you are trying to keep them in sync? Meaning from this point forward, they operate independently? What is the volume you are talking about?
Hi @avillanueva ! Thanks for answering! Yes, these Windchills are the clones of each other. Before the certain time it was a one Windchill in which two different organizations worked, now we have to separate the system, separate the access rights by the products (but the Libraries is stay common) and we need to synchronize the information because the employees of one organization work with the information from the system of another organization (have only READ/DOWNLOAD permissions). As for the volume: it depends on the volume of documentation changes. We synchronize the information periodically (once a week) using the Export/Import Utility (but it cannot to transfer the WT-Documents visualization). But it is obvious that it is not profitable to do it manually.
As I mentioned you’re going to have to write a custom utility to do this. There is no API to copy rep from one windchill system to be rep on another Windchill system.
If I were tasked with doing this I’d do four thing.
1. Write a utility to do the export.
2. Write a utility to do the import.
Assuming the WTDocuments are all WTDocs that have new reps since the last export, I’d also write and schedule a class to run once a week or whenever to find these reps and export them automatically.
On the second system I’d write and schedule a class to get the exported reps and import them automatically to the second system.
This could be fully automated assuming logic exists to get the WTDocs in the first place.
Could be a file with numbers, or Doc’s with new reps since last export, whatever.
But anyway you slice it, even if an admin has to run the utility manually you’re going to need a special utility to do it.
What would be really slick is to do the export/import in real time.
A Doc gets published that’s on your list. The rep gets automatically downloaded. Blah, blah, blah
BTW, the only OOTB way you might pull this off that I’m aware of is using Packages. You can include “Published Content” in a Package. I’ve never used that option but it does exist.
Might be worth a look.
Definitely doable.
This would be done no differently than uploading any content.
Content is content.
But you’re going to have to write your own tool to do it. What you want is quite unique/fringe.
Hi @AP_11091323
I would say that you do not need any api to generate the visualization
if you set the dummy pre-generated configuration then the representation is automatically generated by the system if the PDF is uploaded as an attachment.
CS36856 - How to automatically generate representation for the pre-converted files
So you do not need to send the WTDocument to generate the visualization.
Just save the PDF file as an attachment of the WTDocument
I use it frequently if I generate the PDF from office files. I do not care about the visualization/thumbnail it is done automatically.
PetrH
I don't think that's what he wants to do.
He wants to literally copy the reps of the documents from one system to another system.
This is what he stated:
"I want to create a utility that takes a list of WT_Documents numbers as initial data, downloads the default representations from one Windchill to a local drive, and then creates these representations for the same documents in another Windchill."
You are right in that most of us would just take the list of WTDocuments and publish that list on the second system. But he was pretty clear how he wanted to do it, copy reps from one system to another system. 😁
He states he wants to download the reps from system 1 which must mean he wants to upload the downloaded files to system 2. No?
Hi guys! Thaks for requesting! I will try to clarify what I am going to do:
1. We synchronize information using the Export/Import Utility, so we just export the highest level part that was changed and export it with all related documents and get a big .zip file that contain changed WT-Documents (and the other objects for import). So I can create java utility, that will retrieve the list of WT-Documents from this archive.
2. Some amount of the visualization is made manually and could be modified by author, so I cannot just publish transferred WT-Documents or make representations from the attachments. In addition, some WT-Documents have file, created in the third party CAD editors (for example, AutoCAD) as content and we cannot publish them.
So now I am trying to find the API to retrieve the visualizations by the list of WTDoc numbers from one system then create/update them in another system as they are in the source system. I assume that the utility should work in the following scenario:
1. Admin reseive the WTDoc numbers from the exported .zip during the synchronization (using the utility - it is clear to implementation).
2. Admin get the .zip with the visualizations (PDF files) from the source system by the list using the utility (how to get the visualizations by the number list I don't find yet, but it looks solvable).
3. Admin copy the .zip with visualizations to the target system server with his hands 🙂
4. Admin uploads the visualizations to the target system using a utility (how to create the visualization programmatically using the PDF is not clear).
Basically I am trying to find 2 separate APIs:
1. To programmatically retrieve the visualization as PDF for a WTDoc.
2. To programmatically create/update the visualization using the PDF file from local drive for a WTDoc.
Hi @d_graham
I know, but the headline mentioned the PDF 😄
So I mentioned that option
Also you're right. @AP_11091323 has to write own utility to do so.
PetrH
I’m just reinforcing what I and @HelesicPetr have said. @AP_11091323 ,you, or someone, have to write your own code to do it.
