Quantcast
Channel: PTC Community: Message List - Windchill
Viewing all articles
Browse latest Browse all 8876

Re: WTPart-EPMDocument associations

$
0
0

Next code works fine:

        List<EPMDocument> documents = new ArrayList<EPMDocument>();

 

        AssociatedCADDocs relationship = new AssociatedCADDocs();

        relationship.setTypes(AssociatedCADDocs.Type.IMPLICIT);

        List<Object[]> epmDocs = EPMNavigateHelper.navigate(wtPart, relationship, CollectItem.SEED_ID, CollectItem.OTHERSIDE).getRawResults();

 

        if(epmDocs != null)

        {

            for(Object[] objects : epmDocs)

            {

                for(Object o : objects)

                {

                    if(o instanceof EPMDocument)

                    {

                        documents.add((EPMDocument) o);

                    }

                }

            }

        }

 

And in other direction (not checked):

 

        WTPart wtPart = null;

 

        CADAssociatedParts relationship = new CADAssociatedParts();

        relationship.setTypes(CADAssociatedParts.Type.IMPLICIT);

        List<Object[]> epmDocs = EPMNavigateHelper.navigate(epmDocument, relationship, CollectItem.SEED_ID, CollectItem.OTHERSIDE).getRawResults();

 

        if(epmDocs != null)

        {

            for(Object[] objects : epmDocs)

            {

                for(Object o : objects)

                {

                    if(o instanceof WTPart)

                    {

                        WTPart tempPart = (WTPart) o;

                        if(tempPart.isLatestIteration())

                        {

                            wtPart = tempPart;

                            break;

                        }

                    }

                }

            }

        }


Viewing all articles
Browse latest Browse all 8876

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>