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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

How to create an EPMDocument using a robot.

MaBau
1-Visitor

How to create an EPMDocument using a robot.

Hi everyone,

I am currently trying to create an EPMDocument by using a robot. More specifically, I would like to use a robot to create a notebook, as it is called in Creo (or "layout", if you're using Pro Engineer Wildfire). Does anyone know how to do that? Unfortunately, I don't quite know how to use the classes EPMDocumentType, EPMAuthoringAppTyp and EPMDocSupType.

Can somebody please help me with that?

I'd appreciate it.

Thanks a lot.

Willi

Hi again!

I found this for creating an EPMDocument, but it didn't work.

EPMDocument doc = EPMDocument.newEPMDocument (<number>, <name>, <EPMAuthoringAppType authoring App>, <EPMDocumentType docType>, <CADName>);

so I tried this:

wt.epm.EPMAuthoringAppType at = wt.epm.EPMAuthoringAppType.toEPMAuthoringAppType("PROE");

wt.epm.EPMDocumentType dt = wt.epm.EPMDocumentType.toEPMDocumentType("LAYOUT");

wt.epm.EPMDocument layout=wt.epm.EPMDocument.newEPMDocument(vergabeNumberLayout, vergabeNameLayout, at, dt, vergabeCADNameLayout);

layout.setContainer(pt);

wt.fc.PersistenceHelper.manager.save(layout);

In the "Workflow Process Administration" I got the error: The value of "Owner Application" cannot be set to null, since it is a "required" attribute.

I really don't know how to fix this.

Can someone please help me?

Willi


ACCEPTED SOLUTION

Accepted Solutions
ybagul
12-Amethyst
(To:MaBau)

I guess you have it figured out already by now. Use following statement before you create EPMDoc object.

wt.epm.EPMContextHelper.setApplication(wt.epm.EPMApplicationType.toEPMApplicationType("EPM"));

View solution in original post

2 REPLIES 2
ybagul
12-Amethyst
(To:MaBau)

I guess you have it figured out already by now. Use following statement before you create EPMDoc object.

wt.epm.EPMContextHelper.setApplication(wt.epm.EPMApplicationType.toEPMApplicationType("EPM"));

MaBau
1-Visitor
(To:ybagul)

Hi again,

I am now able to create a new EPMDocument. Thanks to your help. But now I would like to use a template, when creating a new EPMDocument, as a workaround for the following problem:

I can load a primary content, but I am not able to open this content in Creo. When I try to open my EPMDocument (Creo Assembly) in Creo, I somehow get the error that Creo cannot call the EPMDocument. Is it possible to use a template for a CAD Document in a code in my workflow to avoid this problem?

Something like "setTemplate for EPMDocument". Does something like this exist?

I would really appreciate your help.

Thanks a lot..

Announcements


Top Tags