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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

SUMA Bom report, adding reference designators

sdrzewiczewski
10-Marble

SUMA Bom report, adding reference designators

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 1

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;

}




Announcements


Top Tags