1

I am trying to retrieve the CAD model of a part in order to store it in an external application.

I started doing that with info*engine. With info*engine i can retrieve the history of a part, or link two parts together but i didn't find a way to extract the part from windchill.

Any one have an idea how to proceed? Is the use of info*engine the correct way to do that?

Davidmh
  • 3,797
  • 18
  • 35
Anis D
  • 761
  • 11
  • 25

3 Answers3

3

You can do this by Windchill specific API in your java code. Info*engine not needed.

QueryResult qresult = PersistenceHelper.manager.navigate(prt, EPMBuildRule.ROLE_AOBJECT_ROLE, EPMBuildRule.class, true);

Here prtis your wtpart which have cad data in it.

Vignesh Vino
  • 1,242
  • 4
  • 25
  • 50
  • Is it correct to use EPMBuildRuleAssociationLink for non-latest WTParts? This seems to work but i'm not sure about that – chris May 25 '22 at 14:41
0

There is also a helper class with a static method that might help you:

EPMDocument[] epmDocs = ObjectDependencyUtility.getAssociated(part);
JanTheGun
  • 2,165
  • 17
  • 25
0

As Vignesh Vino said, I would try to do this with the standard API. Use the following method:

private QueryResult getActivelyAssociatedParts(EPMDocument doc) throws
  WTException
{
QueryResult qr = null;
if (VersionControlHelper.isLatestIteration(doc))
{
  qr = PersistenceHelper.manager.navigate(doc,
                                          EPMBuildRule.BUILD_TARGET_ROLE,
                                          EPMBuildRule.class);
}
else
{
  qr = PersistenceHelper.manager.navigate(doc,
                                          BuildHistory.BUILT_ROLE,
                                          BuildHistory.class);
}
return qr;
}
flyaround
  • 333
  • 1
  • 5
  • 16