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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! 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