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

Create EPMDocument objects using Windchill API

NP_10570407
11-Garnet

Create EPMDocument objects using Windchill API

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.

ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

6 REPLIES 6

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

 

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. 

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

Thanks a ton @PN_5076692  for sharing the sample code. You answered my question.

rleir
17-Peridot
(To:NP_10570407)

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.

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. 

 

 

Announcements

Top Tags