Skip to main content
10-Marble
May 29, 2012
Question

SUMA Bom report, adding reference designators

  • May 29, 2012
  • 1 reply
  • 644 views

PTC was kind enough to provide me the java code that generates the AML/AVL boms and an example of how to extend it. I can add any additional WTPart attribute, but am not sure how to get the Ref Des, which i believe are stored on the usage link.


If anybody has any suggestions, or snippets, I'd appreciate it.


Thanks,


Steve D.

1 reply

avillanueva
23-Emerald I
May 30, 2012
import wt.part.ReferenceDesignatorSet;

import wt.part.ReferenceDesignatorSetDelegateFactory;

import wt.occurrence.OccurrenceHelper;

import wt.part.PartUsesOccurrence;

import wt.part.WTPartUsageLink;



private String getRefDesString(WTPartUsageLink link) throws WTException

{

String refDes=";//do not return null string, easier to code

QueryResult
result=OccurrenceHelper.service.getUsesOccurrences(link);

if (result.size()>0)

{

List<string> list=new ArrayList<string>();

while (result.hasMoreElements())

{

Object o=result.nextElement();

if (o instanceof PartUsesOccurrence)

{

PartUsesOccurrence puo=(PartUsesOccurrence)o;

list.add(puo.getName());

}

}

ReferenceDesignatorSetDelegateFactory factory=new
ReferenceDesignatorSetDelegateFactory();

ReferenceDesignatorSet set=factory.get(list);

refDes=set.getConsolidatedReferenceDesignators();

}

return refDes;

}