Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Version: Windchill 12.1
Use Case: I want to attached non latest EPMDocument to WTPart using EPMBuildRule
Description:
Hello All,
I want to attached non latest EPMDocument to WTPart using EPMBuildRule but it is always taking latest version of EPMDocument.
How can we do that?
Thanks
Are you trying to do this via a code customization or manually from a workspace? Curious as to why you would want to do this?
Could you describe a little more what the end goal is?
I recently looked into something that may be related. If you have:
Every time you do a build of a CAD assembly using that CAD document, the resulting WTPart structure will use WTPart 2.
I'm not sure what your end goal is, but setting the links may not be enough. I think the Build action itself uses the latest version of the CAD.
Hi @joe_morton
Actually, the link is a version to version so iteration to iteration.
You can have links between each iteration EPM-WTP
PetrH
I could use some more context here, and note as @HelesicPetr states below, the EPMBuildRule link is actually between versions, not between iterations (take a look at the database table - the values are BRANCHIDA3A5 and BRANCHIDA3B5 which point to BRANCHIDITERATIONINFO).
That said, a code fragment to create one is below -- this does not run a build or anything else, it just creates the link.
WTPart workingPart = (WTPart)WorkInProgressHelper.service.checkout(wtPart, WorkInProgressHelper.service.getCheckoutFolder(), "").getWorkingCopy();
EPMBuildRule epmBuildRule = EPMBuildRule.newEPMBuildRule(epmDocument, workingPart, CADHelper.OWNERLINK);
PersistenceHelper.manager.store(epmBuildRule);
WorkInProgressHelper.service.checkin(workingPart, "Link with CAD");