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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

find component children and highlight them

GianVal
15-Moonstone

find component children and highlight them

Hello is it possible to hide the model, then find all the components related to a parent part (e.g. model-1-/3, model-1-/3/3, etc.) and then highlight them?

thank you

1 ACCEPTED SOLUTION

Accepted Solutions

That is fine. Seems that there are different approaches . here for example the selection using the code with custom search function - as one possible option:

2022-06-07_18-02-37.jpg

attached the project , for the case that you want to look on it

View solution in original post

4 REPLIES 4

Hi @GianVal ,

so far I know , it is not easy but possible. So , it is easy if you have a list of all child elements of a component so you can simple hide these items with sequence of calls  as mentioned in the post https://community.ptc.com/t5/Vuforia-Studio/Hide-model-and-isolate-model-item/m-p/797796#M10875

So what I think,  is more difficult is how to create a list of such elements. you can find some consideration in this post. Possibly they could be helpful https://community.ptc.com/t5/Vuforia-Studio-and-Chalk-Tech/How-to-extract-model-data-of-3d-models-in-Vuforia-Studio-without/ta-p/611149

(Status of the post above is old and does not consider the Metadata API) 

I think that what we do in https://community.ptc.com/t5/Vuforia-Studio/Hide-model-and-isolate-model-item/m-p/797796#M10875 - could be easy modified so that we can simple check /select all ID paths which contains /starts with the path of the component for which you need to have the children. Please, let me know if this helps - otherwise I could modify the project accordingly . Thanks 

 

 

as mentioned in my previous post - checked the functionality /sample project from  https://community.ptc.com/t5/Vuforia-Studio/Hide-model-and-isolate-model-item/m-p/797796#M10875  and added a new functionality based on the custom search

 

2022-06-07_17-07-39.jpg

So from a list of sub assembly paths (select-1)  - when it is selected - then it will  hide all components of the assembly and then will search for the components which contains in their idpath the subassembly id path and make them visible. I attached the new version of the project and hope that it helps.

Hello, let me share the solution I found for my use case:

var selected = metadata.getSelected()
for (var i = 0; i < selected.length; i++) {
if (selected[i].startsWith(item)) {
show3DObject('model-1-' + selected[i]);
} else {
hide3DObject('model-1-' + selected[i]);
}

where "item" is the component part id path

That is fine. Seems that there are different approaches . here for example the selection using the code with custom search function - as one possible option:

2022-06-07_18-02-37.jpg

attached the project , for the case that you want to look on it

Top Tags