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

Retrieve assembly components on all levels in Creo 2.0

sergio72
1-Newbie

Retrieve assembly components on all levels in Creo 2.0

Hello,

I have a question about Creo 2.0 and wildfire 4.0 toolkit differences in how code works. I have a toolkit that uses the function ProSolidDispCompVisit to visit all the subcomponents on an assembly, this function works fine in Wildfire 4.0 and it gives me all the child components on all levels for my assembly no matter how deep the tree is, this function gives me all the parts and assemblies under my root assembly, just what I need.
The problem now is I'm going to use Creo 2.0 (datecode M30) and we are updating our code to deal with it. My surprise is that the same code that works fine on Wildfire 4.0 now only gives me the child components contained on the first level of my assembly and it doesn't navigate under those first child, so I can retrieve all assembly levels. It looks like something has changed inside the implementation of toolkit function ProSolidDispCompVisit from Wildfire 4.0 to Creo 2.0 and now only retrieves the first level of the tree. Anyone knows if that is true? Has ProSolidDispCompVisit changed on Creo 2.0? If that's the reason why it not works, how I can retrieve all the child from an assembly in Creo 2.0?

Thanks in advance!!!


















This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
3 REPLIES 3

I'm surprised to hear that ProSolidDispCompVisit traversed all children AND subchildren. I have always used ProSolidFeatVisit (per the direction of the documentation) to visit assembly components. In your action function you must "recurse" if the component is an assembly.

Patrick Williams | Engineering Systems | c: 616.947.2110
[cid:image001.jpg@01D00E02.E330BD10]

Hello Patrick thanks for your quick answer, in the past I used ProSolidFeatVisit as you said but I replaced it by ProSolidDispCompVisit because I notice it goes much faster than ProSolidFeatVisit (maybe because it only visits parts and assemblies) and at least in Wildfire this function goes through all assemblies levels, so it was an improvement on my code. In Creo 2.0 it only retrieves first assembly level, as you appointed, so finally I have solved using some recursive code as you say when the solid retrieved is an assembly. Thanks a lot again for your answer, you given to me an idea of how to solve it.

Hello,



try Creo 2.0 M130 - in this datecode the function ProSolidDispCompVisit()works again as you expect it to work!


It recursively visits all subassemblies and parts. Works also again with simpreps - visits only comps that are currently INCLUDED in the current simprep. The documentation says that it works only on shown layers - I cannot confirm this since I never put models on a layer...



Andreas


__________________________________


Andreas Hellmann
MCAD Services Pro/E & Pro/E customization
Am Wartfeld 7
D-61169 Friedberg


phone: +49 151 21259910

Top Tags