Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
You can refer below artical to create softtype of wtpart using API's
https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS83161&posno=7&q=LWCNormalizedObject%20wtpart&nav=ptcdoctype||SFSolution||Document%20Type||Article&source=Searchhttps://support.ptc.com/appserver/cs/view/solution.jsp?n=CS83161&posno=7&q=LWCNormalizedObject%20wtpart&nav=ptcdoctype||SFSolution||Document%20Type||Article&source=Search
https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS138252&posno=4&q=LWCNormalizedObject%20&nav=ptcdoctype||SFSolution||Document%20Type||Article&source=Search
Thanks,
Shreyas
Hi Randy,
You can do this by:
private WTPart createSoftType(String number, String name, Folder folder) {
WTPart newSoftPart = WTPart.newWTPart(number, name);
FolderHelper.assignLocation(newSoftPart, folder);
TypeIdentifier typeidentifier = TypeHelper.getTypeIdentifier("WCTYPE|wt.part.WTPart|com.mydomain.MyPart");
WCTypeIdentifier wctypeidentifier = (WCTypeIdentifier) typeidentifier;
TypeDefinitionReference typeDefinitionReference = TypedUtilityServiceHelper.service.getTypeDefinitionReference(wctypeidentifier.getTypename());
newSoftPart.setTypeDefinitionReference(typeDefinitionReference);
ViewHelper.assignToView(newSoftPart, ViewHelper.service.getView("Design"));
return (WTPart) PersistenceHelper.manager.save(newSoftPart);
}
Regards