其他 Windchill 功能 > 製造流程管理 > 自訂產品結構總管 (PSE) > 自訂 PSE 以處理模型子類別 > 解決方案 > 寫入自訂類別的複製委派 > 建立複製委派
  
建立複製委派
如圖所示,您只要延伸 wt.enterprise.CopyWTPartDelegate,並重新定義其 newCopy() 方法即可。目的是在這種特定情況 (即 myAttr) 下,處理任何自訂屬性。以下是如何實行此方法的說明:
public final RevisionControlled newCopy( RevisionControlled object
)throws WTException {
//##begin newCopy%461E645C0050f.body preserve=yes
if (object == null) return null;
MyPart new_copy = (MyPart) super.newCopy(object);
MyPart original = (MyPart) object;
String my_attr = original.getMyAttr();
if (my_attr != null) {
try {
new_copy.setMyAttr(original.getMyAttr());
}
catch (WTPropertyVetoException e) {
throw new WTException(e);
}
return new_copy;
//##end newCopy%461E645C0050f.body
}