Skip to main content
12-Amethyst
March 26, 2024
Solved

Create EPMDocument objects using Windchill API

  • March 26, 2024
  • 2 replies
  • 2751 views

I have a requirement to create EPMDocument's in Windchill using Windchill API's..

The native CAD files are stored in a folder drive, for which we have a need to create bulk create EPMDocument objects using API.

No as-stored, No family table data.

I want to create plain EPMDocument's with minimal System OOTB attributes & few custom IBA's.

I want to understand how this objects behave in the system when compared with EPMDocument objects that were created using CAD authoring application.

Please note I have only one option to create these objects using API.

Best answer by PN_5076692

Hello,

 

at SULIS we provide some Import Tools for our customers and we also have Bulk Import Tools for CAD / EPM data.

In the past PTC provided an comfortable API call to create EPMs, but in the current WT versions it's not available anymore.

What you can do is create an EPM step by step and providing all necessary data. But be careful it's not supported by PTC (obviously) and can be tricky too.

 

Here a (very brief) example how to create an EPM

 

EPMAuthoringAppType authoringApp = EPMAuthoringAppType.toEPMAuthoringAppType("PROE");

EPMDocumentType docType = EPMDocumentType.toEPMDocumentType("CADCOMPONENT");

 

EPMApplicationType appType = EPMApplicationType.toEPMApplicationType("EPM");
EPMContextHelper.setApplication(appType);

 

EPMDocument epmdoc = EPMDocument.newEPMDocument(docNumber, docName, authoringApp, docType, cadName);

epmdoc.setDocSubType(EPMDocSubType.getEPMDocSubTypeDefault());

epmdoc.setContainer(ff.getContainer());
FolderHelper.assignLocation(epmdoc, ff);
epmdoc.setPlaceHolder(false);

epmdoc = (EPMDocument) PersistenceHelper.manager.store(epmdoc);

 

After that you can add content / attributes / lifecycle (states)...

 

Regards

Philipp

2 replies

18-Opal
March 26, 2024

@NP_10570407 

 

what does this mean?

Please note I have only one option to create these objects using API.

 

If all you want to do is understand the difference why don’t you create a cad object OOTB using WGM. and then create one using create WTPart and. check create CAD option.

When done compare the database entries for each.

Or create Cad using APIs and compare.

 

12-Amethyst
March 27, 2024

Hi @d_graham 

Thanks for the reply.

My scenario: I have bulk Catia & Creo native cad files stored in shared folder location. the file count is around 5000..

I want to load these files into Windchill server. I don't want to use WBM. Hence going with the option of developing custom loader utility.

I am looking for suggestions  with the above mentioned option.

Thanks in advance. 

10-Marble
March 27, 2024

Hello,

 

at SULIS we provide some Import Tools for our customers and we also have Bulk Import Tools for CAD / EPM data.

In the past PTC provided an comfortable API call to create EPMs, but in the current WT versions it's not available anymore.

What you can do is create an EPM step by step and providing all necessary data. But be careful it's not supported by PTC (obviously) and can be tricky too.

 

Here a (very brief) example how to create an EPM

 

EPMAuthoringAppType authoringApp = EPMAuthoringAppType.toEPMAuthoringAppType("PROE");

EPMDocumentType docType = EPMDocumentType.toEPMDocumentType("CADCOMPONENT");

 

EPMApplicationType appType = EPMApplicationType.toEPMApplicationType("EPM");
EPMContextHelper.setApplication(appType);

 

EPMDocument epmdoc = EPMDocument.newEPMDocument(docNumber, docName, authoringApp, docType, cadName);

epmdoc.setDocSubType(EPMDocSubType.getEPMDocSubTypeDefault());

epmdoc.setContainer(ff.getContainer());
FolderHelper.assignLocation(epmdoc, ff);
epmdoc.setPlaceHolder(false);

epmdoc = (EPMDocument) PersistenceHelper.manager.store(epmdoc);

 

After that you can add content / attributes / lifecycle (states)...

 

Regards

Philipp

17-Peridot
March 27, 2024

Does your company support bottom-up design, or top-down design? 

You will be thinking that this is irrelevant to your question, but no. Windchill is designed to link a WTPart to each EPMDocument. If you do bulk creation of the latter, you will be soon looking for a way to create the corresponding WTParts.

10-Marble
March 27, 2024

No, it not irrelevant πŸ˜‰  It's quite important as you stated.

 

The code above is just a small code block to show how to create an EPM doc with API calls. But it's only a very small part of the whole picture of bulk loading EPMs / data.

 

Our importers are able to bulk load EPMs, add attributes & other meta data, attach content, add visualization data (if already available), create and add a WTPart(s), build the according BOMs (including occurrence data), as well as create and link related WTDocs.

The importer is also able to build a full history if the data is available for that.