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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

How to know a part has structure or not

pshashipreetham
17-Peridot

How to know a part has structure or not

Hi,

 

Is there a REST API or Swagger where I can input the Part number and know if it has a part structure?

 

Use Case: If a part has a part structure, display the part structure in Thingworx Dashboard, or else display just the part info.

 

For this use case, I need to know if there is an API, I can ping and understand if the Part has structure or not.

 

Thanks,

 

 

Shashi Preetham
1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

 

I found the simplest way to know if a part has the structure or not; below is the implementation:

pshashipreetham_0-1697782211431.png

In the JSON, if HasChildren is true, there is structure to the Part. If not, there is no structure to it.

If you need the whole structure to the Part, then add the below to the expand: 

 

$expand: "Components($expand=Part,PartUse;$levels=1)",

 

 

Thanks,

Shashi Preetham

View solution in original post

2 REPLIES 2

Hi @pshashipreetham 

 

If you have Thingworx Navigate Configured, you can use the 'getPartStructureByID' service ( service will be available in Windchill ODataConnector ) to fetch part structure windchill using Part ID ( not part Name )

 

If the 'Components' array is empty you can consider your part doesn't have any structure

 

Velkumar_0-1683621430651.png

 

If your part has structure result will look something like this 

 

Velkumar_1-1683621633571.png

 

In WRS, you can use the below endpoint to fetch the part structure

Velkumar_2-1683621996315.png

 

/VR

 

Hello,

 

I found the simplest way to know if a part has the structure or not; below is the implementation:

pshashipreetham_0-1697782211431.png

In the JSON, if HasChildren is true, there is structure to the Part. If not, there is no structure to it.

If you need the whole structure to the Part, then add the below to the expand: 

 

$expand: "Components($expand=Part,PartUse;$levels=1)",

 

 

Thanks,

Shashi Preetham
Top Tags