Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
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.
Solved! Go to Solution.
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
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.
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.