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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Associate WTPart with EPMDocument

DB_11361720
4-Participant

Associate WTPart with EPMDocument

Hi, My goal now is to create a EPMDocument in a Workspace with associated WTPart by REST APIs 
What I plant to do: 
Step1: Create a EPMDocument in Workspace

API: Windchill/servlet/rest/v1/wgm/workspaces/{workspaceId}/store
=> Done
Step2: Create a WTPart

API: Windchill/servlet/odata/ProdMgmt/Parts
=> Error here
My body:

{
    "Name":"testToday",
    "AssemblyMode": {
      "Value""separable",
      "Display""Separable"
    },
    "PhantomManufacturingPart" : false,
    "Organization@odata.bind""Groups('OR:wt.org.WTOrganization:123')",
    "Context@odata.bind""Containers('OR:wt.inf.library.WTLibrary:123')"
}
Error
{
    "error": {
        "code"null,
        "message""The wcType: com.ptc.ElectricalPart is invalid"
    }
}

Step3: Create Association

API: Windchill/servlet/rest/v1/wtparts/{WTPart}/associations/to/documents


Does anyone have faced with similar error in step2? Please help me to fix. Thank so much !

5 REPLIES 5
Fadel
22-Sapphire II
(To:DB_11361720)

Would you test the steps in https://www.ptc.com/en/support/article/CS398513 

Fede
DB_11361720
4-Participant
(To:Fadel)

When I visit your link, it show
Note: This article 398513 is not customer visible.
Can you explain the solution in these steps in the comment.
Thank you so much

Fadel
22-Sapphire II
(To:DB_11361720)

My bad, indeed the article is PTC INTERNAL,.

The article suggest one of the below  2 options :

  1. import com.ptc.ElectricalPart type from Out-Of-The-Box Windchill into affected environment using LoadFromFile framework
  2. Delete the Windchill REST Services configuration files for Electrical Part
 
Fede

Hi @DB_11361720,


I wanted to see if you got the help you needed.


If so, please mark the appropriate reply as the Accepted Solution or please feel free to detail in a reply what has helped you and mark it as the Accepted Solution. It will help other members who may have the same question.
Please note that industry experts also review the replies and may eventually accept one of them as solution on your behalf.


Of course, if you have more to share on your issue, please pursue the conversation.

Thanks,

Catalina
PTC Community Moderator
rleir
17-Peridot
(To:DB_11361720)

Your error message applies to step 2 only, so let's look at that and ignore your other steps for a moment.

 

Look in your 'Type and Attribute Management' under Site Utilities. Have you defined com.ptc.ElectricalPart? Are you able to create a part with this type by using the Windchill 'New Part' UI?

 

In the Windchill/servlet/odata/ProdMgmt/Parts API, can you do a GET and see the com.ptc.ElectricalPart that you created?

Announcements


Top Tags