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

Re: How to create Parent & Child WTPart using Code ?

$
0
0

Hi Guru,

 

I dont know the exact way.But you may try this

 

 

WTPart workingCopy;

WTPart part = WTPart.newWTPart("myPartNumber", "MyPartName");

part.setContainer(c.getContainer());

PersistenceHelper.

manager.save(part);

 

WTPart childPart = WTPart.newWTPart("myChildPartNumber", "MyChildPartName");

childPart.setContainer(c.getContainer());

PersistenceHelper.

manager.save(childPart);

 

workingCopy = (WTPart)WorkInProgressHelper.

service.checkout(part, WorkInProgressHelper.service.getCheckoutFolder(), null).getWorkingCopy();

 

WTPartUsageLink link = WTPartUsageLink.newWTPartUsageLink(workingCopy, (WTPartMaster) childPart.getMaster());

 

Persistable per2 = PersistenceHelper.

manager.save(link);

WorkInProgressHelper.

service.checkin(workingCopy,null);


Viewing all articles
Browse latest Browse all 8876

Trending Articles



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