Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Is there anyone who has an example of code or webject to create an MBOM from an EBOM or a part?
Thanks,
/Gustav
Hi Gustav,
You can use below method to create WTPart with Manufacturing view from Design view.
The code is only for a Part.
/**
* Creating manugfacturing part.
*
* @param latestPartDesign
* given {@link WTPart}.
*
* @return {@link WTPart}.
*
* @throws WTPropertyVetoException
* throws {@link WTPropertyVetoException}.
*
* @throws WTException
* throws {@link WTException}.
*/
public static WTPart createManufacturingPart(WTPart latestPartDesign)
throws WTPropertyVetoException, WTException {
WTPart partManufacturing = null;
WTPart latestPart = latestPartDesign;
LOG.debug("Latest part view :: " + latestPart.getViewName());
if (!"Manufacturing".equalsIgnoreCase(latestPart.getViewName())) {
partManufacturing = ((WTPart) ViewHelper.service.newBranchForView(
latestPartDesign, "Manufacturing"));
partManufacturing = ((WTPart) PersistenceHelper.manager
.store(partManufacturing));
} else {
partManufacturing = (WTPart) PersistenceHelper.manager
.refresh(latestPart);
}
return partManufacturing;
}
Regards,
Kaushik