windchill 获取文档子类型内部名称和显示

1. 场景:

获取文档的内部名称:

2. 代码

            WTDocument doc = DocUtils.getDocumentByOid("VR:wt.doc.WTDocument:115509");
            // 获取子类型 内部名称
            String type = TypeIdentifierUtilityHelper.service.getTypeIdentifier(doc).toString();
            System.out.println(type); //输出结果: WCTYPE|wt.doc.WTDocument|com.yjgroup.Trial_Product_List
                 
            //获取子类型 子类型显示名称
            TypeIdentifier typeIdentifier = TypeIdentifierHelper.getType(doc);
            TypeDefinitionReadView readView = TypeDefinitionServiceHelper.service.getTypeDefView(typeIdentifier);
            String typeDisplay = readView.getDisplayName();
            System.out.println(typeDisplay); //输出结果:产品试制单

3.输出结果

posted @ 2020-12-21 16:50  Wzzzz~  阅读(923)  评论(0)    收藏  举报