Skip to main content
11-Garnet
March 23, 2013
Solved

Use of "calculated link" in webject - need help

  • March 23, 2013
  • 2 replies
  • 5016 views

Hi everybody,

I am trying to get information about creo drawing object (in WIndchill 10.1) and I hit the wall. So far I was able to get information about creo drawing using "Query-Links" webject, and it looked fine, at first, but. The creo part is a part of a assembly and assembly also has a drawing so instead of getting one I got to drawing objects.

<ie:webject name="Query-Links" type="OBJ">

<ie:param name="INSTANCE" data="<%=wtInstance%>"/>

<ie:param name="TYPE" data="wt.epm.structure.EPMReferenceLink"/>

<ie:param name="DIRECTION" data="referencedBy"/>

<ie:param name="OBJECT_REF" data="VR:wt.epm.EPMDocument:162399"/>

<ie:param name="AUTO_NAVIGATE" data="TRUE"/>

<ie:param name="SELECTEDBY" data="LATEST"/>

<ie:param name="OUTPUT_TYPE" data="FULL"/>

<ie:param name="ATTRIBUTE" data="number,name" delim=","/>

<ie:param name="GROUP_OUT" data="output"/>

</ie:webject>

I also tried bunch of other different link types (EPMDerivedRepRule, EPMDerivedRepRule, EPMDescribeLink, ...) but with out result. I stumble on the peace of text in the one of Windchill manuals that say "An association between a part and the engineering drawing derived from its owner-associated CAD model is automatically created upon initial upload. This association is labeled Calculated, and is not a modeled “link” in the database, but is an included association type when CAD documents are collected for actions."

So if anybody can give me advice or point to right direction what is "the name" of calculated link so it can be used in webject (or this can't be done) or is there any other way to get reference to drawing of particular creo part.

Thanks!

Best answer by GregoryPERASSO

The method you are using above if for retrieving Drawing CADDoc from 3D CADDoc.

The calculated link is between a WTPart and a Drawing CADDoc

You can use this API

CADAssociatedParts relationship =

new CADAssociatedParts();

relationship.setTypes(

CADAssociatedParts.Type.IMPLICIT);

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

2 replies

GregoryPERASSO
16-Pearl
March 25, 2013

Hello

the calculated link is not persisted in the database.

So I don't think tant the webject QueryLink is able to find it.

It is calculated , by retrieving reference drawings linked to the "owner" 3D CAD Document of the WTpart, and applying an "as stored baseline" filter.

There's java API that permit to retrieve it. You should be able to use them and store the result in a Webject result, if you realy need an InfoEngine return

regards

Gregory

nbojcetic11-GarnetAuthor
11-Garnet
March 25, 2013

Hi Gregory,

thank yout for your replay. Using info engine is not required. I tried also using java API but I got the sam result (see code). Do you know the method or function name to use calculated link in java?

public static EPMDocument getDrawingModel(EPMDocument model) throws WTException {

// model is creo part object

EPMDocument drawing = null;

qr = EPMStructureHelper.service.navigateReferencedBy((EPMDocumentMaster) model.getMaster(),

null, true);

while (qr.hasMoreElements()) {

drawing = (EPMDocument) qr.nextElement();

System.out.println("obj 1: " + drawing.getIdentity() + "." + drawing.getIterationIdentifier().getValue());

}

return drawing;

}

Best regards

Nenad

GregoryPERASSO
16-Pearl
March 25, 2013

The method you are using above if for retrieving Drawing CADDoc from 3D CADDoc.

The calculated link is between a WTPart and a Drawing CADDoc

You can use this API

CADAssociatedParts relationship =

new CADAssociatedParts();

relationship.setTypes(

CADAssociatedParts.Type.IMPLICIT);

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

1-Visitor
July 29, 2014

Have you got this worked out? Perhaps you can try this java drawing qr code.

If you got the solution to your problem, would you mind sharing it with us here. Sorry that I replied to such an old thread, I'm just really curious how this turned out.

nbojcetic11-GarnetAuthor
11-Garnet
July 29, 2014

Hi Sherley,

the code from previous post worked fine. The trick is, what Gregory suggested, to use Remote Method Invocation, or another way is to embed your code in Windchill GUI than it can run without RMI.

1-Visitor
July 30, 2014

Got it. Thanks for the info!