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

Export all CAD from Windchill database

MattPat
12-Amethyst

Export all CAD from Windchill database

Hi,

One of my clients wants to shut down the old Windchill server. They probably won't use old files from the server but they want to export them and maybe use some of them in the future. 

Is it possible to export all data from Oracle Database using for example data pump and extract it? it will be possible then to open these exported files in Creo? 

Thanks in advance.

 

16 REPLIES 16
BenLoosli
22-Sapphire III
(To:MattPat)

The CAD data is not in Oracle, only the metadata which contains the pointer from the actual file name to the sequential numbered files in the Vault. You can open the files from the vault and the file name is in the header information.

To maintain file structures and linkages, your best method is to open each drawing in Creo and do a backup to a single folder or a folder for each drawing. This will insure that you capture all related file to the drawing. It is time consuming as I had to do this for 35 drawings that a customer wanted from us. 

Hello,

 

This is typical use case. If the properites wt.fv.forceContentToVault in wt.properties is set to true , all content will go to vault. Otherwise content will go to database.

 

You have below options available 

1. Take a snapshot of the system . e.g. amazon aws snapshot , vmware snapshot  along with db snapshot and then shutdown the system.

2. Export data manually in Creo

3. For larger number , you can use script like JLink script to download the files on the disk. 

 

Let me know if you need any further details.

 

Thanks and Regards

Ajit

Hi, 

thank you for your response.

Can you tell me more about JLink? I have thousands of files to download to the disk. I want only the last iteration and version of asm and prt files. 

nbojcetic
6-Contributor
(To:MattPat)

Hello,

there is one more option that I used. From the database you can find relation between CAD Name nad file name in the Vault. So you

can write simple bat procedure do rename Vault files. Then files can be directly opened in the Creo.

 

Best regards

You could create a Windchill Package of the data which would give you a ZIP of all the requested files.

https://www.ptc.com/en/support/article/CS22813

Hi, 

thank you for your answer. I read more about Creo Packages but where I should run the export command? Windchill Shell doesn't recognize WPCExport command. 

Thanks in advance

There is no WC shell commands for Packages. Everything is defined in the application UI.

  • Create a new package
  • Add the desired items using Collector to gather all dependencies
  • Lock the package
  • Create a delivery
  • ZIP the delivery
  • Download the ZIP

Hi Scott,

I think the package is the way I will choose. 

Is there any option to select all files from context/folder to export? In package creation, I have to choose files manually one by one, what if we have thousands of them?

Is there any automatic way? I want to export only part/assembly in the latest iteration.

The best way will be to write some customization for automatically creating a package from the product folder/context and then manually delivering a zip. 

Thanks in advance 🙂 

Scott already responded, but packages is the way I would go as well.

 

Mike C.

 

I think package is the way I will choose. I made some tests and I have another question. 

Is there any option to select all files from context/folder to export? In package creation, I have to choose files manually one by one, what if we have thousands of them? Is there any automatic way? I want to export only part/assembly in the latest iteration.

If creating a really big package, you'll want to make sure you choose an appropriate size to split up the ZIP file. If its more than a GB, the java process creating the ZIP could definitely be problematic if not assigned to its own background method server which is sized appropriately.

Matt,

 

Is the content stored in file vaults or in BLOBs in the dB? Could be one or the other or a mixture of the two. Anything is possible.

As always, it’s a good to know the ground rules before doing anything.

 

Are you looking to get all iterations of every number?

Just the latest iteration of each revision of every number?

Just the latest iteration of every number?

 

If just latest it would be easy to write code that downloads the CAD files (with the correct filename) to a folder on a server.


If you need more that just the latest iteration I suggest appending a “.#” to the filename. For example, let’s say you have ten iterations of the same number. Save the latest widget.prt.10, the next latest as widget.prt.9, etc.

 

This can easily be automated by writing code to do the entire dB. Just write a query to get all EPMDoc masters. For each master query all iterations (or all versions whatever you need). Get the size of the query (this would be used as the number you append to the filename subtracting 1 for each iteration).

Loop thru the iteration query streaming the content to your folder with the appropriate filename.

If ten iteration the query size is 10 so the first iteration streamed is <filename>.10, the second is <filename>.9, etc.

 

I would also suggest having the code write a log that records the filename version.iteration (and any other metadata you’d be interested in).

 

Thats how I’d do it. Wouldn’t take much to write it either. Run it from a Windchill shell and your done 👍


Hope this is helpful.

If you decide to go this route and need help with the code let me know.

 

David

dnordin
14-Alexandrite
(To:MattPat)

Since you are just looking to export the latest of the .asm and .prt files, I'd suggest the following as an alternative method to packages or custom programming. Also, I believe that packages have a limit to the number of items that can be included in the package, but that would need to be verified.

 

1. Modify the limit on the number of resulting items in a search and table display. This will allow you to search for all .asm and .prt files and get the results in a single search results table.
2. In a Creo Parametric session, search for all objects of type CAD Document. Since you've specified searching for just CAD Documents, you can set the criteria to "Filename=*.asm" or "Filename=*.prt". [If you want the drawings, skip the criteria settings and just use a keyword of *]. You can save the search if you plan on running this multiple times [for testing, etc.].
3. Change the search results table display to include the location [full context folder path] of the objects, and the filename [not the name or number, but the real Creo Parametric filename]. You should also include any other columns that are of interest; name, number, description, version, last modified, etc.
4. Export the search results table to a .csv file. This file can be used as a record of what was in the database that includes some of the database metadata (the columns you added to the search table results).
5. Add everything in the search results table to a new workspace (WS). No dependents (because you searched for everything), no drawings, no family table, no generics (if you have nested family tables), and latest iteration. If your family tables are clean, there should be no conflicts/errors.
6. You should now have every .asm and .prt file in a WS. Modify the WS table display to only show CAD Documents and filter out family table instances [Instance NE Yes] because family table instances don't have a real file to export. Include the filename and location again.
7. Save the table display to a .csv file. This will serve as a record of what was actually exported. It can also be used later to build a folder structure identical to the Windchill folder structure.
8. Export everything from your WS. No dependents, no drawings, no secondary content, etc.
9. You now have every .asm and .prt file in a single directory on your hard drive. Compare the directory listing against the WS .csv file to validate that everything was successfully exported.
10. Optionally, you can create a small script to recreate the folder structure from Windchill on disk and move the exported files into the appropriate folders. The WS .csv file contains the "location" information from Windchill along with the filename.

 

Regards,

 

Dan N.

I saw your second post regarding this.  I still think if you are simply downloading/copying the content to a folder where you can zip it a java script to do this is the way to go.

The script could add the content directly to a zip file but I'm thinking it might be good to see the files in a folder before compressing it.

 

That said, I wrote script to do it and it works fine.  I did run it on a test system with a limited amount of data and for testing I limited it to all CAD Assemblies and CAD Components (Drawings, Formats and whatever can easily be added) but even so I used a direct dB sql select statement so that the script would have no limit on the number of objects it finds.

Before

d_graham_0-1637021523942.png

 

Run script in Windchill shell.

Note the path to the file in the vault.

d_graham_1-1637021668687.png

After

d_graham_2-1637021692050.png

 

Easy way to get CAD files out of Windchill.

I can also include a log of everything that was copied including and metadata associated with each object.

I think that might be helpful too.

 

David

HJ1
13-Aquamarine
13-Aquamarine
(To:d_graham)

Hi!

A bit off topic, but related to extracting data...

We're possibly coming up with a requirement to extract pdf-files from Attachments of EPMDoc drawings and the same for wtDocuments linked to a wtPart structure. Extract would be 'triggered' from a subassembly or the top wtPart. Drawings are with Calculated association to wtPart and wtDocs with Referenced by links. Also, we're using baselines to capture the BOM and the above mentioned content versions which should be considered.

 

Based on your experiences to extract files do you see the above doable?

 

d_graham
16-Pearl
(To:HJ1)

@HJ1 , the answer to your question is yes.

All of what you describe is very doable. As long as there is sound logic provided (which you have 👍) code can be written to get the attachments you described.

 

How do you intend to trigger the ‘extraction’ of the attachments? Admin runs code in Windchill shell? User runs code from the part’s page?

 

If you need help with this let me know.

 

David

 

PS

Interesting that you mention how you’re capturing the BOM. I just wrote a utility to display a “released” part structure where the parts’ lifecycles each include multiple states that are considered “released” states.

 

 

BTW, for those of you following this post. The original poster has subsequently told me that the data he needs to get out of the database is in fact stored in BLOBs in the dB not in file vaults. Therefore I adjusted my code to work regardless of where the data is stored. Could be in BLOBs, file vaults or a combination of the two. Now it’s bombproof 😀

Announcements