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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Code or webject to create MBOM

gjärund
7-Bedrock

Code or webject to create MBOM

Is there anyone who has an example of code or webject to create an MBOM from an EBOM or a part?

Thanks,

/Gustav

1 REPLY 1
KD
12-Amethyst
12-Amethyst
(To:gjärund)

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

Announcements

Top Tags