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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

For a Part, how to set the Default Downstream Location i.e. Folder Location where the Downstream view is to be created

prathi
12-Amethyst

For a Part, how to set the Default Downstream Location i.e. Folder Location where the Downstream view is to be created

Folder structure for our product:
Design

Manufacturing

 

Design Engineer creates part in Design Folder.

MBOM Creator open the part in Manufacturing Associate Part Structure Browser (MPSAB) and then creates a New Downstream Branch of the part. The default location for this is /Default of the Product which can be changed manually by browsing to required location.

We want to change this Default location to /Default/Manufacturing.

Please suggest steps.

12 REPLIES 12
BineshKumar1
13-Aquamarine
(To:prathi)

It is controlled by a preference.

manufactLocation.jpg

If you like, you can also write a delegate that uses a logic for number, location and so on.

Hi Binesh,

We already tried that preference. This preference sets a fixed location for creation of Downstream parts i.e a folder where downstream parts from all the products will be stored. What we need is that Downstream parts of each product should be stored in the Manufacturing folder of that particular product itself.

Regards,

Prasad

BineshKumar1
13-Aquamarine
(To:prathi)

Hi Prasad, I know it is not easy to set this preference in each of the products. I think writing your own delegate overriding DefaultDownstreamLocationDelegate is the elegant. I wish this is more configurable

We need exactly the same functionality. Setting the downstream location to a default Manufacturing folder in each product.

 

@BineshKumar1 Do you happen to have an example on how to create such a custom delegate?

Thank you Gregory,

I was looking for this forever!!!

tm-4
11-Garnet
(To:prathi)

Hi,

 

PFB custom delegate to achieve this functionality,

 

public class MyCustomDelegateLocation extends DefaultDownstreamLocationDelegate{

  private static final String LOCATION_PATH_SEPARATOR = "/";
        @Override
        public STAInitialLocationValueBean getSTAInitialLocationValueBean(List<ObjectReference> refs){
       
  //Returns the location of the passed objects
        STAInitialLocationValueBean locationBean = new STAInitialLocationValueBean();

         for (final ObjectReference ref : refs) {
             WTContained persistable = (WTContained) ref.getObject();
             final Identifier associative_identifier = EntityUtils.toIdentifier(persistable);
             if (persistable instanceof Associative) {
    locationBean.addFolderIdForLocation(LOCATION_PATH_SEPARATOR + persistable.getContainerName(),Manufacturing)
                locationBean.addInitialLocationForAssociative(associative_identifier, LOCATION_PATH_SEPARATOR + persistable.getContainerName());
            }
        }
        return locationBean;
 }
}

 

Thanks and Regards,

Thiagarajan

Arjen
12-Amethyst
(To:tm-4)

Hello Thiagarajan,

We tested this example but unfortunately the code is not working properly. Did you test it or adjusted it? Is it working at your system? If yes, can you share the working code?

IViana
7-Bedrock
(To:Arjen)

Hi Arjen, 

Have you tested other code to work properly with DefaultDownstreamLocationDelegate? 

Thanks!

ocorten-2
12-Amethyst
(To:IViana)

See this article: https://www.ptc.com/en/support/article/CS278477

Maybe that helps you further.

Thank you for your article, but unfortunately the code is not working properly. 

BR, 

HelesicPetr
22-Sapphire I
(To:IViana)

Hi @IViana 

 

You need to be more descriptive. What does it mean the code does not work properly?

 

PetrH

Announcements


Top Tags